diff options
author | Felix Fietkau <nbd@nbd.name> | 2020-07-27 13:27:52 +0200 |
---|---|---|
committer | Felix Fietkau <nbd@nbd.name> | 2020-07-27 13:27:53 +0200 |
commit | ac0710b7a3c6fc3b7b90d5ddc9a57b437e8e3ac5 (patch) | |
tree | 16b230c12bee4b0689ee38382187b440243459e9 /device.c | |
parent | 6086b63b4ca24ce4f23774d5ad49b5791f0b1705 (diff) |
device: look up full device name before traversing vlan chain
The user may have configured a VLAN device with explicit settings and the same
name by adding a config device section
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Diffstat (limited to 'device.c')
-rw-r--r-- | device.c | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -572,13 +572,14 @@ device_get(const char *name, int create) { struct device *dev; - if (strchr(name, '.')) + dev = avl_find_element(&devices, name, dev, avl); + + if (!dev && strchr(name, '.')) return get_vlan_device_chain(name, create); if (name[0] == '@') return device_alias_get(name + 1); - dev = avl_find_element(&devices, name, dev, avl); if (dev) { if (create > 1 && !dev->external) { system_if_apply_settings(dev, &dev->settings, dev->settings.flags); |