diff options
author | Jernej Jakob <jernej.jakob@gmail.com> | 2020-05-01 16:33:31 +0200 |
---|---|---|
committer | Jernej Jakob <jernej.jakob@gmail.com> | 2020-05-04 22:59:39 +0200 |
commit | 600b3bc874355237d24bbe38660478a43ce6c946 (patch) | |
tree | a21c1d1c27b5f205645300c7b123b5137975431f /src/conf_mode | |
parent | 512510b887408d8263865197fc936501ee453064 (diff) | |
download | vyos-1x-600b3bc874355237d24bbe38660478a43ce6c946.tar.gz vyos-1x-600b3bc874355237d24bbe38660478a43ce6c946.zip |
bonding: 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
- always re-add the interface back to any bridge it is part of in
case it is deleted and recreated
Diffstat (limited to 'src/conf_mode')
-rwxr-xr-x | src/conf_mode/interfaces-bonding.py | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/conf_mode/interfaces-bonding.py b/src/conf_mode/interfaces-bonding.py index 235b24439..a8900ac76 100755 --- a/src/conf_mode/interfaces-bonding.py +++ b/src/conf_mode/interfaces-bonding.py @@ -405,8 +405,14 @@ def apply(bond): for addr in bond['address']: b.add_addr(addr) - # assign/remove VRF - b.set_vrf(bond['vrf']) + # assign/remove VRF (ONLY when not a member of a bridge, + # otherwise 'nomaster' removes it from it) + if not bond['is_bridge_member']: + b.set_vrf(bond['vrf']) + + # re-add ourselves to any bridge we might have fallen out of + if bond['is_bridge_member']: + b.add_to_bridge(bond['is_bridge_member']) # remove no longer required service VLAN interfaces (vif-s) for vif_s in bond['vif_s_remove']: |