From 37973a13bbc168c09e5f4d1e606f91fd7ffbb41a Mon Sep 17 00:00:00 2001 From: Thomas Mangin Date: Wed, 8 Apr 2020 22:44:02 +0100 Subject: tunnel: T2028: prevent single 'remote' keyword When the remote keywrod is ommited, the default value of '' is still set, therefore the ip command will include it. Remote is now removed if unset. --- src/conf_mode/interfaces-tunnel.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/conf_mode/interfaces-tunnel.py b/src/conf_mode/interfaces-tunnel.py index 646e61c53..4a042f1b9 100755 --- a/src/conf_mode/interfaces-tunnel.py +++ b/src/conf_mode/interfaces-tunnel.py @@ -420,9 +420,9 @@ def verify(conf): incompatible = [] if afi_local == IP6: - incompatible.extend(['ttl', 'tos', 'key',]) + incompatible.extend(['remote','ttl', 'tos', 'key',]) if afi_local == IP4: - incompatible.extend(['encaplimit', 'flowlabel', 'hoplimit', 'tclass']) + incompatible.extend(['remote','encaplimit', 'flowlabel', 'hoplimit', 'tclass']) for option in incompatible: if option in options: -- cgit v1.2.3 From 62210a1de8ae87980f1b1880736d1cded327cb46 Mon Sep 17 00:00:00 2001 From: Thomas Mangin Date: Wed, 8 Apr 2020 23:14:38 +0100 Subject: tunnel: T2028: register the _Tunnel class All interface classes register themselves so that we can figure out from an interface name what class is responsible for its creation. In the case of Tunnel, it is not the case as multiple different interfaces are sharing the same "tun" prefix. Still many operations are the same and it should be done. --- python/vyos/ifconfig/tunnel.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/vyos/ifconfig/tunnel.py b/python/vyos/ifconfig/tunnel.py index 1bbb9eb6a..05060669a 100644 --- a/python/vyos/ifconfig/tunnel.py +++ b/python/vyos/ifconfig/tunnel.py @@ -31,7 +31,7 @@ def enable_to_on(value): raise ValueError(f'expect enable or disable but got "{value}"') - +@Interface.register class _Tunnel(Interface): """ _Tunnel: private base class for tunnels -- cgit v1.2.3