summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorChristian Breunig <christian@breunig.cc>2023-10-03 20:51:21 +0200
committerChristian Breunig <christian@breunig.cc>2023-10-08 09:58:45 +0200
commitab2aeec41a2ef34730b9dc8894b184e0bf00b147 (patch)
treeaf51c0a604609874fe0a8d367fca92238d7657f5 /src
parent88c1fd3a35926d813967b3c969e01b41ea67771a (diff)
downloadvyos-1x-ab2aeec41a2ef34730b9dc8894b184e0bf00b147.tar.gz
vyos-1x-ab2aeec41a2ef34730b9dc8894b184e0bf00b147.zip
pppoe: T5630: verify MRU is less or equal then MTU
(cherry picked from commit e357258e645cf85de0035d4ecfbf99db4dd90f7e)
Diffstat (limited to 'src')
-rwxr-xr-xsrc/conf_mode/interfaces-pppoe.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/conf_mode/interfaces-pppoe.py b/src/conf_mode/interfaces-pppoe.py
index 6c4c6c95b..49714c558 100755
--- a/src/conf_mode/interfaces-pppoe.py
+++ b/src/conf_mode/interfaces-pppoe.py
@@ -59,6 +59,11 @@ def verify(pppoe):
if {'connect_on_demand', 'vrf'} <= set(pppoe):
raise ConfigError('On-demand dialing and VRF can not be used at the same time')
+ # both MTU and MRU have default values, thus we do not need to check
+ # if the key exists
+ if int(pppoe['mru']) > int(pppoe['mtu']):
+ raise ConfigError('PPPoE MRU needs to be lower then MTU!')
+
return None
def generate(pppoe):