summaryrefslogtreecommitdiff
path: root/src/conf_mode/interfaces-wireless.py
diff options
context:
space:
mode:
authorJernej Jakob <jernej.jakob@gmail.com>2020-04-22 17:12:25 +0200
committerJernej Jakob <jernej.jakob@gmail.com>2020-04-23 16:09:33 +0200
commitd6c08414d55eadd8232b693303f2b14bfe121c01 (patch)
treecf7e5bd23fb6f2efa9f376cf4eec440bac31ff81 /src/conf_mode/interfaces-wireless.py
parent76feb7d154a452ba5475b9b6ee720a7a8f5491d5 (diff)
downloadvyos-1x-d6c08414d55eadd8232b693303f2b14bfe121c01.tar.gz
vyos-1x-d6c08414d55eadd8232b693303f2b14bfe121c01.zip
interfaces: T2362: delete and re-add all EUI64 addresses if MAC has changed
Diffstat (limited to 'src/conf_mode/interfaces-wireless.py')
-rwxr-xr-xsrc/conf_mode/interfaces-wireless.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/conf_mode/interfaces-wireless.py b/src/conf_mode/interfaces-wireless.py
index e7c14e3fb..82a5a892a 100755
--- a/src/conf_mode/interfaces-wireless.py
+++ b/src/conf_mode/interfaces-wireless.py
@@ -25,7 +25,7 @@ from netaddr import EUI, mac_unix_expanded
from vyos.config import Config
from vyos.configdict import list_diff, vlan_to_dict
-from vyos.ifconfig import WiFiIf
+from vyos.ifconfig import WiFiIf, Section
from vyos.ifconfig_vlan import apply_vlan_config, verify_vlan_config
from vyos.template import render
from vyos.util import chown, call
@@ -402,6 +402,12 @@ def get_config():
if conf.exists('mac'):
wifi['mac'] = conf.return_value('mac')
+ # Find out if MAC has changed - if so, we need to delete all IPv6 EUI64 addresses
+ # before re-adding them
+ if ( wifi['mac'] and wifi['intf'] in Section.interfaces(section='wireless')
+ and wifi['mac'] != WiFiIf(wifi['intf'], create=False).get_mac() ):
+ wifi['ipv6_eui64_prefix_remove'] += wifi['ipv6_eui64_prefix']
+
# Maximum number of wireless radio stations
if conf.exists('max-stations'):
wifi['max_stations'] = conf.return_value('max-stations')