diff options
author | Jernej Jakob <jernej.jakob@gmail.com> | 2020-05-01 20:07:25 +0200 |
---|---|---|
committer | Jernej Jakob <jernej.jakob@gmail.com> | 2020-05-04 22:59:40 +0200 |
commit | bca5864a1b1182b9c2b2949cddfb715f51535ffb (patch) | |
tree | 2227b5bf63ef34df9365495d7af6f7a7443007d1 /src/conf_mode | |
parent | 9282b705afa350c49bfef4bdd46bf96c19aef5a0 (diff) | |
download | vyos-1x-bca5864a1b1182b9c2b2949cddfb715f51535ffb.tar.gz vyos-1x-bca5864a1b1182b9c2b2949cddfb715f51535ffb.zip |
wirelessmodem: T2241: fix falling out of bridge when changing settings
Previously, the interface was always deleted and recreated, which
removed it from the bridge.
- always re-add the interface back to any bridge it is part of
Diffstat (limited to 'src/conf_mode')
-rwxr-xr-x | src/conf_mode/interfaces-wirelessmodem.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/conf_mode/interfaces-wirelessmodem.py b/src/conf_mode/interfaces-wirelessmodem.py index 313d19470..cf2945593 100755 --- a/src/conf_mode/interfaces-wirelessmodem.py +++ b/src/conf_mode/interfaces-wirelessmodem.py @@ -21,6 +21,7 @@ from copy import deepcopy from netifaces import interfaces from vyos.config import Config +from vyos.ifconfig import BridgeIf, Section from vyos.template import render from vyos.util import chown, chmod_755, cmd, call from vyos.validate import is_member @@ -205,6 +206,12 @@ def apply(wwan): # make logfile owned by root / vyattacfg chown(wwan['logfile'], 'root', 'vyattacfg') + # re-add ourselves to any bridge we might have fallen out of + # FIXME: wwan isn't under vyos.ifconfig so we can't call + # Interfaces.add_to_bridge() so STP settings won't get applied + if wwan['is_bridge_member'] in Section.interfaces('bridge'): + BridgeIf(wwan['is_bridge_member'], create=False).add_port(wwan['intf']) + return None if __name__ == '__main__': |