openwrt / openwrt/packages

ModemManager: broken in 22.03/23.05 and netifd reconnect issue

Open
#19,794 51 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

release/22.03 release/23.05
Dominant language
Makefile
Stars
4.6k
Forks
4k
Avg merge
3d 12h
Merged PRs (30d)
134

Description

Firstly, ModemManager is broken in 22.03 because modem disconnect does not reach through to netifd absent this patch from @aleksander0m: https://github.com/openwrt/packages/commit/bc754f31cfdb004eefa43038f8f0827922107fc6

In short, ModemManager sees the disconnect, but netifd does not and the output of e.g. 'ifstatus' or 'ip addr show dev' is wrong (reflecting the old connected state and not updated to reflect disconnection). See e.g. here: https://github.com/openwrt/openwrt/issues/8368#issuecomment-1299719052.

So ModemManager in 22.03 needs to be updated to fix this.

Secondly, even with the above patch in the ModemManager version on OpenWrt master, upon disconnection we see:

Wed Nov  2 20:38:54 2022 daemon.info [2716]: <info>  [modem0] state changed (connected -> disconnecting)
Wed Nov  2 20:38:54 2022 daemon.info [2716]: <info>  [modem0] state changed (disconnecting -> registered)
Wed Nov  2 20:38:54 2022 daemon.info [2716]: <info>  [modem0/bearer3] connection #1 finished: duration 121s, tx: 258333 bytes, rx: 371928 bytes
Wed Nov  2 20:38:54 2022 user.notice modemmanager: interface wan (network device wwan0) disconnected
Wed Nov  2 20:38:54 2022 daemon.notice netifd: Interface 'wan' has lost the connection
Wed Nov  2 20:38:54 2022 daemon.notice netifd: Network device 'wwan0' link is down
Wed Nov  2 20:38:54 2022 daemon.warn dnsmasq[1]: no servers found in /tmp/resolv.conf.d/resolv.conf.auto, will retry

And so although now with the patched version of ModemManager netifd sees the disconnect, netifd does not actually reconnect.

This is using /etc/config/network:

config interface 'wan'
        option proto 'modemmanager'
        option device '/sys/devices/platform/1e1c0000.xhci/usb2/2-1'
        option auth 'pap'
        option iptype 'ipv4v6'
        option apn 'xx
        option username 'yy'
        option password 'zz'

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the ModemManager disconnect log and the /etc/config/network modemmanager interface shown in the issue, then compare the referenced package patch with the 22.03, 23.05, and master behavior. Reproduce a modem disconnect and verify that netifd updates its state and reconnects; done means both behaviors work consistently.

Written by the indexing model from the issue text.

Assessment

Domain
networking
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.