Skip to content

Commit bd93800

Browse files
authored
Merge pull request #4527 from cblackburn-igl/current
T7492: Fix modem connection code
2 parents a3b5108 + 77b999e commit bd93800

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/conf_mode/interfaces_wwan.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
from vyos.configverify import verify_mtu_ipv6
3030
from vyos.ifconfig import WWANIf
3131
from vyos.utils.dict import dict_search
32+
from vyos.utils.network import is_wwan_connected
3233
from vyos.utils.process import cmd
3334
from vyos.utils.process import call
3435
from vyos.utils.process import DEVNULL
@@ -137,7 +138,7 @@ def apply(wwan):
137138
break
138139
sleep(0.250)
139140

140-
if 'shutdown_required' in wwan:
141+
if 'shutdown_required' in wwan or (not is_wwan_connected(wwan['ifname'])):
141142
# we only need the modem number. wwan0 -> 0, wwan1 -> 1
142143
modem = wwan['ifname'].lstrip('wwan')
143144
base_cmd = f'mmcli --modem {modem}'
@@ -159,7 +160,7 @@ def apply(wwan):
159160

160161
return None
161162

162-
if 'shutdown_required' in wwan:
163+
if 'shutdown_required' in wwan or (not is_wwan_connected(wwan['ifname'])):
163164
ip_type = 'ipv4'
164165
slaac = dict_search('ipv6.address.autoconf', wwan) != None
165166
if 'address' in wwan:

0 commit comments

Comments
 (0)