modemmanager: explicitly disconnect even if no bearers found
authorAleksander Morgado <aleksander@aleksander.es>
Mon, 13 Jun 2022 10:24:43 +0000 (12:24 +0200)
committerFederico Capoano <f.capoano@openwisp.io>
Thu, 27 Oct 2022 16:48:21 +0000 (13:48 -0300)
commita0c8f1028fe0752ddc61a70f7ac8f24a30f37d77
treea8276c9d3e03b3229a8ad227ff4f7dc0a05e790c
parent9b502e8cb088c2f4f9495a8073d1549ef182e3a5
modemmanager: explicitly disconnect even if no bearers found

A network restart where netifd is cleanly restarted involves bringing
the network interfaces down. The 'modemmanager' protocol handler will
run a mmcli --simple-disconnect in this case, but only if there are
bearer objects found.

If the network restart happened *during* the connection attempt
procedure, while the modem is e.g. being registered in the network, no
bearer objects exist yet, and so, we would skip doing anything during
the interface teardown operation. This would lead to the original
connection attempt succeeding, so leaving the modem in ModemManager
in connected state, while the associated interface in netifd is
reported down.

Signed-off-by: Aleksander Morgado <aleksander@aleksander.es>
(cherry picked from commit c15e94f6c5fbbaedd41fd74b930a2a205f80afc0)
net/modemmanager/files/modemmanager.proto