Skip to content

device: skip VLAN chain lookup for existing kernel interfaces#71

Open
ghoker143 wants to merge 1 commit intoopenwrt:masterfrom
ghoker143:master
Open

device: skip VLAN chain lookup for existing kernel interfaces#71
ghoker143 wants to merge 1 commit intoopenwrt:masterfrom
ghoker143:master

Conversation

@ghoker143
Copy link

netifd's __device_get() treats any interface name containing a '.' as a
VLAN-style device by immediately dispatching to get_vlan_device_chain().

Modern externally-managed interfaces such as the rmnet mux links created
by ModemManager for QMI QMAP multiplexing (e.g. qmapmux0.0, qmapmux0.1)
are legitimate kernel netdevices that happen to contain a dot. When
ModemManager calls notify_proto with such an ifname, netifd incorrectly
tries to resolve it as a VLAN device:

ubus call network.device status '{"name":"qmapmux0.0"}'
=> { "type": "VLAN", "present": false }

This causes notify_proto to fail with "Unknown error" and the interface
never comes up under netifd control.

Fix: before dispatching to get_vlan_device_chain(), probe the kernel with
if_nametoindex(). If the full dotted name already exists as a real netdev,
skip the VLAN path and fall through to the normal device lookup / creation
path. This preserves all existing VLAN behaviour: when eth0.10 does not
yet exist in the kernel, if_nametoindex("eth0.10") returns 0 and netifd
still creates it as a VLAN device as before.

Signed-off-by: ghoker143 <ghoker51@protonmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant