Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions device.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
#include <net/if.h>
#include <assert.h>

#include <sys/types.h>
Expand Down Expand Up @@ -893,8 +894,16 @@ __device_get(const char *name, int create, bool check_vlan)

dev = avl_find_element(&devices, name, dev, avl);

if (!dev && check_vlan && strchr(name, '.'))
return get_vlan_device_chain(name, create);
if (!dev && check_vlan && strchr(name, '.')) {
/*
* Only treat dotted names as VLAN-style if the full name does
* NOT already exist as a real kernel netdev. Externally managed
* interfaces (e.g. ModemManager QMI mux links: qmapmux0.0) are
* valid kernel devices whose names happen to contain a dot.
*/
if (!if_nametoindex(name))
return get_vlan_device_chain(name, create);
}

if (name[0] == '@')
return device_alias_get(name + 1);
Expand Down