From 2cee4be6641cea69fdf4319d4d106723242ba1ba Mon Sep 17 00:00:00 2001 From: Christian Poessinger Date: Tue, 25 Feb 2020 09:58:12 +0100 Subject: 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' --- src/conf_mode/interfaces-pppoe.py | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/conf_mode/interfaces-pppoe.py') 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): -- cgit v1.2.3