summaryrefslogtreecommitdiff
path: root/src/conf_mode/interfaces-wireless.py
diff options
context:
space:
mode:
authorChristian Poessinger <christian@poessinger.com>2020-10-01 21:47:29 +0200
committerChristian Poessinger <christian@poessinger.com>2020-10-01 21:48:34 +0200
commitf7907fbdbbe21058694b1076028ea4c19b9045eb (patch)
tree39075bb4084a9670b68aeeb02e1e6cadbe5cef25 /src/conf_mode/interfaces-wireless.py
parent4cfb3515475d95313ad1840978ee09704bd6351a (diff)
downloadvyos-1x-f7907fbdbbe21058694b1076028ea4c19b9045eb.tar.gz
vyos-1x-f7907fbdbbe21058694b1076028ea4c19b9045eb.zip
wireless: T2653: mangle RADIUS default values
With commit 38ae3032 ("pppoe-server: T2936: move to get_config_dict()") there are now RADIUS default values present in the XML definitions - those must be proberly mangled for the WiFi interface.
Diffstat (limited to 'src/conf_mode/interfaces-wireless.py')
-rwxr-xr-xsrc/conf_mode/interfaces-wireless.py19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/conf_mode/interfaces-wireless.py b/src/conf_mode/interfaces-wireless.py
index f8520aecf..ad8aee168 100755
--- a/src/conf_mode/interfaces-wireless.py
+++ b/src/conf_mode/interfaces-wireless.py
@@ -74,7 +74,18 @@ def get_config(config=None):
else:
conf = Config()
base = ['interfaces', 'wireless']
+
wifi = get_interface_dict(conf, base)
+ # defaults include RADIUS server specifics per TAG node which need to be
+ # added to individual RADIUS servers instead - so we can simply delete them
+ if vyos_dict_search('security.wpa.radius.server.port', wifi):
+ del wifi['security']['wpa']['radius']['server']['port']
+ if not len(wifi['security']['wpa']['radius']['server']):
+ del wifi['security']['wpa']['radius']
+ if not len(wifi['security']['wpa']):
+ del wifi['security']['wpa']
+ if not len(wifi['security']):
+ del wifi['security']
if 'security' in wifi and 'wpa' in wifi['security']:
wpa_cipher = wifi['security']['wpa'].get('cipher')
@@ -99,6 +110,14 @@ def get_config(config=None):
tmp = find_other_stations(conf, base, wifi['ifname'])
if tmp: wifi['station_interfaces'] = tmp
+ # Add individual RADIUS server default values
+ if vyos_dict_search('security.wpa.radius.server', wifi):
+ default_values = defaults(base + ['security', 'wpa', 'radius', 'server'])
+
+ for server in vyos_dict_search('security.wpa.radius.server', wifi):
+ wifi['security']['wpa']['radius']['server'][server] = dict_merge(
+ default_values, wifi['security']['wpa']['radius']['server'][server])
+
return wifi
def verify(wifi):