summaryrefslogtreecommitdiff
path: root/device.c
diff options
context:
space:
mode:
authorHans Dedecker <dedeckeh@gmail.com>2016-06-06 14:58:32 +0200
committerFelix Fietkau <nbd@nbd.name>2016-06-06 15:42:01 +0200
commitca2f99575937b183618e425a73b45bcc277b5541 (patch)
tree4f57fbdb9549992bc760596db0c39a461a57648f /device.c
parent29521f9a232f039318fd8525c410b3127836626f (diff)
downloadnetifd-ca2f99575937b183618e425a73b45bcc277b5541.tar.gz
device: Fix dotted vlan interface staying down
Using the config below a dotted vlan interface stays down as get_vlan_device does not find the device due to the aliased device stacked on top of the base device. As all devices; aliased devices being the exception; are in the device list use device_find to find the device when setting the link state config interface 'test' option proto 'static' option ipaddr '192.168.2.1' option netmask '255.255.255.0' config interface 'test2' option ifname '@test.1' option proto 'dhcp' Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
Diffstat (limited to 'device.c')
-rw-r--r--device.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/device.c b/device.c
index a4d804e..fa3d00f 100644
--- a/device.c
+++ b/device.c
@@ -477,6 +477,14 @@ device_create_default(const char *name, bool external)
}
struct device *
+device_find(const char *name)
+{
+ struct device *dev;
+
+ return avl_find_element(&devices, name, dev, avl);
+}
+
+struct device *
device_get(const char *name, int create)
{
struct device *dev;