summaryrefslogtreecommitdiffhomepage
path: root/device.c
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2011-04-03 18:52:31 +0200
committerFelix Fietkau <nbd@openwrt.org>2011-04-03 18:52:31 +0200
commitcdc92e3fa1f188faecc0d97014866fe9a80d5570 (patch)
tree60052a8fccf569f863a6578a4eb690a4a738644a /device.c
parentdc4d06fd667a399bfa77da1cb2eb4487ebeba498 (diff)
initialize device names earlier
Diffstat (limited to 'device.c')
-rw-r--r--device.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/device.c b/device.c
index 1f84a83..0efdba5 100644
--- a/device.c
+++ b/device.c
@@ -93,12 +93,12 @@ void init_virtual_device(struct device *dev, const struct device_type *type, con
assert(dev);
assert(type);
+ if (name)
+ strncpy(dev->ifname, name, IFNAMSIZ);
+
fprintf(stderr, "Initialize interface '%s'\n", dev->ifname);
INIT_LIST_HEAD(&dev->users);
dev->type = type;
-
- if (name)
- strncpy(dev->ifname, name, IFNAMSIZ);
}
int init_device(struct device *dev, const struct device_type *type, const char *ifname)