summaryrefslogtreecommitdiff
path: root/src/conf_mode/interfaces-wireless.py
diff options
context:
space:
mode:
authorMarcus Hoff <marcus.hoff@ring2.dk>2020-10-03 13:46:22 +0200
committerMarcus Hoff <marcus.hoff@ring2.dk>2020-10-03 13:46:22 +0200
commit000c18e7ccaf8a7e265b078211837c6fcf3e8179 (patch)
tree67d87ea5f5541109e9f273c73f71f40ceffdd567 /src/conf_mode/interfaces-wireless.py
parent1141bee72677b25d18436975625d2d298be503ff (diff)
parente4e75aacac93f320a20ad367bdfc8aa2c21596ef (diff)
downloadvyos-1x-000c18e7ccaf8a7e265b078211837c6fcf3e8179.tar.gz
vyos-1x-000c18e7ccaf8a7e265b078211837c6fcf3e8179.zip
Merge remote-tracking branch 'upstream/current' into current
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):