- Status Unconfirmed
- Percent Complete
- Task Type Bug Report
- Category Base system
- Assigned To No-one
- Operating System All
- Severity Low
- Priority Very Low
- Reported Version Trunk
- Due in Version Undecided
-
Due Date
Undecided
- Private
FS#3499 - [netifd] no way to monitor the real state of a connection via protocol handlers
The current ModemManager integration in netifd is not fully operational right now, and usually requires an additional management script on top of it to properly reconnect the modems under certain scenarios.
The simplest and most common use case is the following:
* The network interface configured for “modemmanager” protocol is ifup-ed.
* netifd runs the connection start procedure in the protocol handler and the modem gets connected.
* Some time passes, and the network operator decides to disconnect the connection (network-initiated disconnection).
* ModemManager detects the disconnection, reports the bearer objects a “disconnected” and the modem back to only “registered”.
* netifd still thinks the interface is up, and reports it as up everywhere.
See e.g. https://github.com/openwrt/packages/issues/14096
What would be the best way to solve this issue?
Is there currently any way to extend the protocol handler in a way that allows some polling inside netifd to ensure the interface is still up? Would that be a big change? Any other solution suggested?
Hi,
Thank you for you work with ModemManager!
For a long time, I have used a USB NCM modem (without knowing of MM),
and have wanted a way for it to detect disconnect and automatically reconnect.
I do not know ModemManager, or ubus / netifd.
I do not know if it works, but it looks like at one stage, ppp used netifd for reconnects:
https://github.com/openwrt-mirror/openwrt/commit/3411334dd8d55107fe9dc1fcf018b28fcbbeb90b
Could we use MM's dbus state change to make a ubus call to netifd?
Even if it is an external daemon monitoring dbus?
https://www.freedesktop.org/software/ModemManager/api/latest/ModemManager-Flags-and-Enumerations.html#MMModemState
Example:
From the ppp proto, the proto_run_command uses the ip-down-script /lib/netifd/ppp-down, which sends a message to netifd via ubus through the shell library.
https://github.com/openwrt/openwrt/blob/master/package/network/services/ppp/files/lib/netifd/ppp-down
Netifd shell functions:
/lib/netifd/netifd-proto.sh
https://git.openwrt.org/?p=project/netifd.git;a=blob;f=scripts/netifd-proto.sh
json shell functions:
/usr/share/libubox/jshn.sh
https://git.openwrt.org/?p=project/libubox.git;a=blob;f=sh/jshn.sh
If something like this might work, I can keep digging?
Cheers