summaryrefslogtreecommitdiff
path: root/src/conf_mode/interfaces-bonding.py
diff options
context:
space:
mode:
authorJernej Jakob <jernej.jakob@gmail.com>2020-05-02 15:11:48 +0200
committerJernej Jakob <jernej.jakob@gmail.com>2020-05-02 20:40:43 +0200
commitcf1ec3c1ebdd71dae741fa1f34bce6719ee0ef50 (patch)
tree5b9eae177aa87a5d2bd271b6cbf86f07a883a848 /src/conf_mode/interfaces-bonding.py
parenta4e29a0de10572e8bfb2804a86ae3aa3eaac5ff7 (diff)
downloadvyos-1x-cf1ec3c1ebdd71dae741fa1f34bce6719ee0ef50.tar.gz
vyos-1x-cf1ec3c1ebdd71dae741fa1f34bce6719ee0ef50.zip
bonding: T2367: flush all addresses of member interfaces
Any remaining addresses of an interface (e.g. IPv6 link-local) will be flushed when adding a member. A direct call to ip is necessary for interfaces not under the Interface class (e.g. vlan vif*)
Diffstat (limited to 'src/conf_mode/interfaces-bonding.py')
-rwxr-xr-xsrc/conf_mode/interfaces-bonding.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/conf_mode/interfaces-bonding.py b/src/conf_mode/interfaces-bonding.py
index 4aef486b4..4ec30ca0a 100755
--- a/src/conf_mode/interfaces-bonding.py
+++ b/src/conf_mode/interfaces-bonding.py
@@ -24,7 +24,7 @@ from vyos.ifconfig import BondIf, Section
from vyos.ifconfig_vlan import apply_vlan_config, verify_vlan_config
from vyos.configdict import list_diff, vlan_to_dict
from vyos.config import Config
-from vyos.util import call
+from vyos.util import call, cmd
from vyos.validate import is_bridge_member
from vyos import ConfigError
@@ -492,6 +492,12 @@ def apply(bond):
# Add (enslave) interfaces to bond
for intf in bond['member']:
+ # flushes only children of Interfaces class (e.g. vlan are not)
+ if intf in Section.interfaces():
+ klass = Section.klass(intf, vlan=False)
+ klass(intf, create=False).flush_addrs()
+ # flushes also vlan interfaces
+ call(f'ip addr flush dev "{intf}"')
b.add_port(intf)
# As the bond interface is always disabled first when changing