device: skip VLAN chain lookup for existing kernel interfaces#71
Open
ghoker143 wants to merge 1 commit intoopenwrt:masterfrom
Open
device: skip VLAN chain lookup for existing kernel interfaces#71ghoker143 wants to merge 1 commit intoopenwrt:masterfrom
ghoker143 wants to merge 1 commit intoopenwrt:masterfrom
Conversation
Signed-off-by: ghoker143 <ghoker51@protonmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.