diff options
author | Christian Poessinger <christian@poessinger.com> | 2020-05-21 17:23:29 +0200 |
---|---|---|
committer | Christian Poessinger <christian@poessinger.com> | 2020-05-21 17:23:29 +0200 |
commit | f8e2d8acd8a036a041cf4b51891d21a3c809afb0 (patch) | |
tree | 8ec864cf4cfebc4d7b6ada870409670db41b7c3e /src/conf_mode/interfaces-macsec.py | |
parent | ab29e70bdd5b5a70e8e8822d521130a63055ada8 (diff) | |
download | vyos-1x-f8e2d8acd8a036a041cf4b51891d21a3c809afb0.tar.gz vyos-1x-f8e2d8acd8a036a041cf4b51891d21a3c809afb0.zip |
macsec: T2023: stop wpa_supplicant on interface deletion
Diffstat (limited to 'src/conf_mode/interfaces-macsec.py')
-rwxr-xr-x | src/conf_mode/interfaces-macsec.py | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/conf_mode/interfaces-macsec.py b/src/conf_mode/interfaces-macsec.py index ed88e877d..d251f6408 100755 --- a/src/conf_mode/interfaces-macsec.py +++ b/src/conf_mode/interfaces-macsec.py @@ -62,6 +62,11 @@ def get_config(): # Check if interface has been removed if not conf.exists(base_path): macsec['deleted'] = True + # When stopping wpa_supplicant we need to stop it via the physical + # interface - thus we need to retrieve ir from the effective config + if conf.exists_effective(base_path + ['source-interface']): + macsec['source_interface'] = conf.return_effective_value(base_path + ['source-interface']) + return macsec # set new configuration level @@ -164,7 +169,7 @@ def generate(macsec): def apply(macsec): # Remove macsec interface if macsec['deleted']: - call('systemctl stop wpa_supplicant-macsec@{intf}.service'.format(**macsec)) + call('systemctl stop wpa_supplicant-macsec@{source_interface}.service'.format(**macsec)) MACsecIf(macsec['intf']).remove() else: |