From 9b268012252a4fe6f253177830abde950e2773b5 Mon Sep 17 00:00:00 2001 From: Christian Poessinger Date: Fri, 25 Sep 2020 20:57:37 +0200 Subject: ifconfig: T2912: add helper to verify interface min/max supported MTU Currently the MTU size of an interface is only checked when entered via CLI but if the interface supportes the configured MTU at all is not verified at all. New helper functions get_min_mtu(), get_max_mtu() and verify_mtu() have been added to provide a central API for validation. --- python/vyos/ifconfig/interface.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'python/vyos/ifconfig') diff --git a/python/vyos/ifconfig/interface.py b/python/vyos/ifconfig/interface.py index a0f0ffe04..d200fc7a8 100644 --- a/python/vyos/ifconfig/interface.py +++ b/python/vyos/ifconfig/interface.py @@ -299,7 +299,7 @@ class Interface(Control): >>> Interface('eth0').get_min_mtu() '60' """ - return self.get_interface('min_mtu') + return int(self.get_interface('min_mtu')) def get_max_mtu(self): """ @@ -310,7 +310,7 @@ class Interface(Control): >>> Interface('eth0').get_max_mtu() '9000' """ - return self.get_interface('max_mtu') + return int(self.get_interface('max_mtu')) def get_mtu(self): """ -- cgit v1.2.3