diff options
author | Jernej Jakob <jernej.jakob@gmail.com> | 2020-05-01 19:45:11 +0200 |
---|---|---|
committer | Jernej Jakob <jernej.jakob@gmail.com> | 2020-05-04 22:59:39 +0200 |
commit | f45c165ca53d4c9e8017d36940de768d7419e097 (patch) | |
tree | 707a3c16b19f1fed914fd05f590f9d86efbd5d4b /src/conf_mode | |
parent | 50ca89433c2a29367a36f5f049821a9bedb39d24 (diff) | |
download | vyos-1x-f45c165ca53d4c9e8017d36940de768d7419e097.tar.gz vyos-1x-f45c165ca53d4c9e8017d36940de768d7419e097.zip |
pseudo-ethernet: T2241: fix falling out of bridge when changing settings
Previously, the interface was always deleted and recreated, which removed it
from the bridge.
- add checks to make VRF and bridge membership mutually exclusive
- always re-add the interface back to any bridge it is part of
Diffstat (limited to 'src/conf_mode')
-rwxr-xr-x | src/conf_mode/interfaces-pseudo-ethernet.py | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/conf_mode/interfaces-pseudo-ethernet.py b/src/conf_mode/interfaces-pseudo-ethernet.py index e06f14a95..bd0942fd8 100755 --- a/src/conf_mode/interfaces-pseudo-ethernet.py +++ b/src/conf_mode/interfaces-pseudo-ethernet.py @@ -213,8 +213,10 @@ def apply(peth): # IPv6 Duplicate Address Detection (DAD) tries p.set_ipv6_dad_messages(peth['ipv6_dup_addr_detect']) - # assign/remove VRF - p.set_vrf(peth['vrf']) + # assign/remove VRF (ONLY when not a member of a bridge, + # otherwise 'nomaster' removes it from it) + if not peth['is_bridge_member']: + p.set_vrf(peth['vrf']) # Delete old IPv6 EUI64 addresses before changing MAC for addr in peth['ipv6_eui64_prefix_remove']: @@ -245,6 +247,10 @@ def apply(peth): for addr in peth['address']: p.add_addr(addr) + # re-add ourselves to any bridge we might have fallen out of + if peth['is_bridge_member']: + p.add_to_bridge(peth['is_bridge_member']) + # remove no longer required service VLAN interfaces (vif-s) for vif_s in peth['vif_s_remove']: p.del_vlan(vif_s) |