summaryrefslogtreecommitdiff
path: root/src/conf_mode/interfaces-pppoe.py
diff options
context:
space:
mode:
authorChristian Poessinger <christian@poessinger.com>2020-02-25 09:58:12 +0100
committerChristian Poessinger <christian@poessinger.com>2020-02-25 09:58:14 +0100
commit2cee4be6641cea69fdf4319d4d106723242ba1ba (patch)
treece592b11e6b1d540ad6503cb14c0d56102e7e274 /src/conf_mode/interfaces-pppoe.py
parentcd2147cfa2dc3202fa044b17592a6ddb28275daa (diff)
downloadvyos-1x-2cee4be6641cea69fdf4319d4d106723242ba1ba.tar.gz
vyos-1x-2cee4be6641cea69fdf4319d4d106723242ba1ba.zip
pppoe: T1318: validate existing source-interface
It is not only sufficient to check if there is a source-interface configured, but rather it must also be checked if the source-interface exists at all in the system. If the interface does not exist pppd will complain with: pppd[2778]: /usr/sbin/pppd: In file /etc/ppp/peers/pppoe1: unrecognized option 'eth0.202'
Diffstat (limited to 'src/conf_mode/interfaces-pppoe.py')
-rwxr-xr-xsrc/conf_mode/interfaces-pppoe.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/conf_mode/interfaces-pppoe.py b/src/conf_mode/interfaces-pppoe.py
index cb09b6f29..2bfabd9d5 100755
--- a/src/conf_mode/interfaces-pppoe.py
+++ b/src/conf_mode/interfaces-pppoe.py
@@ -209,6 +209,9 @@ def verify(pppoe):
if not pppoe['source_interface']:
raise ConfigError('PPPoE source interface is missing')
+ if pppoe['source_interface'] not in interfaces():
+ raise ConfigError('PPPoE source interface does not exist')
+
return None
def generate(pppoe):