summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorChris Blackburn <chris.blackburn@infinitivegroup.co.uk>2025-05-27 20:27:34 +0100
committerChris Blackburn <chris.blackburn@infinitivegroup.co.uk>2025-05-27 20:27:34 +0100
commit77b999e897b088bb990324d511b6f190073abd71 (patch)
tree433c8b4a17295badd92ae167bad3d56289d48daf /src
parenta81ab0c6808080f521bfb673c61f90a744c625ff (diff)
downloadvyos-1x-77b999e897b088bb990324d511b6f190073abd71.tar.gz
vyos-1x-77b999e897b088bb990324d511b6f190073abd71.zip
T7492: Fix modem connection code
Added another possible condition to the flow through the config apply function so that interfaces will reconnect as expected, even when there has been no significant change to the contig tags.
Diffstat (limited to 'src')
-rwxr-xr-xsrc/conf_mode/interfaces_wwan.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/conf_mode/interfaces_wwan.py b/src/conf_mode/interfaces_wwan.py
index ddbebfb4a..fb71731d8 100755
--- a/src/conf_mode/interfaces_wwan.py
+++ b/src/conf_mode/interfaces_wwan.py
@@ -29,6 +29,7 @@ from vyos.configverify import verify_vrf
from vyos.configverify import verify_mtu_ipv6
from vyos.ifconfig import WWANIf
from vyos.utils.dict import dict_search
+from vyos.utils.network import is_wwan_connected
from vyos.utils.process import cmd
from vyos.utils.process import call
from vyos.utils.process import DEVNULL
@@ -137,7 +138,7 @@ def apply(wwan):
break
sleep(0.250)
- if 'shutdown_required' in wwan:
+ if 'shutdown_required' in wwan or (not is_wwan_connected(wwan['ifname'])):
# we only need the modem number. wwan0 -> 0, wwan1 -> 1
modem = wwan['ifname'].lstrip('wwan')
base_cmd = f'mmcli --modem {modem}'
@@ -159,7 +160,7 @@ def apply(wwan):
return None
- if 'shutdown_required' in wwan:
+ if 'shutdown_required' in wwan or (not is_wwan_connected(wwan['ifname'])):
ip_type = 'ipv4'
slaac = dict_search('ipv6.address.autoconf', wwan) != None
if 'address' in wwan: