use list_add_tail instead of list_add
[project/netifd.git] / interface.c
index 2b66fb9..20956be 100644 (file)
@@ -24,7 +24,7 @@ static const union config_param_info iface_attr_info[IFACE_ATTR_MAX] = {
 
 static const struct blobmsg_policy iface_attrs[IFACE_ATTR_MAX] = {
        [IFACE_ATTR_PROTO] = { .name = "proto", .type = BLOBMSG_TYPE_STRING },
-       [IFACE_ATTR_IFNAME] = { .name = "ifname", .type = BLOBMSG_TYPE_ARRAY },
+       [IFACE_ATTR_IFNAME] = { .name = "ifname", .type = BLOBMSG_TYPE_STRING },
        [IFACE_ATTR_AUTO] = { .name = "auto", .type = BLOBMSG_TYPE_BOOL },
 };
 
@@ -216,7 +216,7 @@ interface_alloc(const char *name, struct uci_section *s, struct blob_attr *attr)
        iface->main_dev.cb = interface_cb;
        iface->l3_iface = &iface->main_dev;
        strncpy(iface->name, name, sizeof(iface->name) - 1);
-       list_add(&iface->list, &interfaces);
+       list_add_tail(&iface->list, &interfaces);
        INIT_LIST_HEAD(&iface->errors);
        INIT_LIST_HEAD(&iface->address);
        INIT_LIST_HEAD(&iface->routes);