summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJernej Jakob <jernej.jakob@gmail.com>2020-05-01 19:51:56 +0200
committerJernej Jakob <jernej.jakob@gmail.com>2020-05-04 22:59:39 +0200
commit6866efd1081c39b50a473b58aea61188f4eb6d6e (patch)
tree35797338dddda65fb736c1b6c6c536ef58db9983
parentc6fba800f088ca389bd73386793b5444ef185c22 (diff)
downloadvyos-1x-6866efd1081c39b50a473b58aea61188f4eb6d6e.tar.gz
vyos-1x-6866efd1081c39b50a473b58aea61188f4eb6d6e.zip
tunnel: T2241: fix falling out of bridge when changing settings
Previously, set_vrf was always called, which uses the same master and nomaster commands as bridge, so it removed the interface from the bridge. - add checks to make VRF and bridge membership mutually exclusive
-rwxr-xr-xsrc/conf_mode/interfaces-tunnel.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/conf_mode/interfaces-tunnel.py b/src/conf_mode/interfaces-tunnel.py
index 2ef1017c9..57bc3b8e0 100755
--- a/src/conf_mode/interfaces-tunnel.py
+++ b/src/conf_mode/interfaces-tunnel.py
@@ -633,12 +633,17 @@ def apply(conf):
# set other interface properties
for option in ('alias', 'mtu', 'link_detect', 'multicast', 'allmulticast',
- 'vrf', 'ipv6_autoconf', 'ipv6_forwarding', 'ipv6_dad_transmits'):
+ 'ipv6_autoconf', 'ipv6_forwarding', 'ipv6_dad_transmits'):
if not options[option]:
# should never happen but better safe
continue
tunnel.set_interface(option, options[option])
+ # assign/remove VRF (ONLY when not a member of a bridge,
+ # otherwise 'nomaster' removes it from it)
+ if not options['bridge']:
+ tunnel.set_vrf(options['vrf'])
+
# Configure interface address(es)
for addr in options['addresses-del']:
tunnel.del_addr(addr)