use list_add_tail instead of list_add
authorFelix Fietkau <nbd@openwrt.org>
Sun, 4 Sep 2011 12:07:28 +0000 (14:07 +0200)
committerFelix Fietkau <nbd@openwrt.org>
Sun, 4 Sep 2011 12:07:28 +0000 (14:07 +0200)
device.c
interface-ip.c
interface.c

index bc870c24eb74fce34953ee462839bf88f9e4eadb..0019b6c2481185b5b34c5bc02d90410204565f55 100644 (file)
--- a/device.c
+++ b/device.c
@@ -242,7 +242,7 @@ void device_set_present(struct device *dev, bool state)
 void device_add_user(struct device_user *dep, struct device *dev)
 {
        dep->dev = dev;
-       list_add(&dep->list, &dev->users);
+       list_add_tail(&dep->list, &dev->users);
        if (dep->cb && dev->present) {
                dep->cb(dep, DEV_EVENT_ADD);
                if (dev->active)
index 6c673c69272f1044cdb7c6e91f2129937aff6441..2a26a4af06f8fb570b237a6e51b504c59afe4bf0 100644 (file)
@@ -18,7 +18,7 @@ int interface_add_address(struct interface *iface, struct device_addr *addr)
        else
                family = AF_INET;
 
-       list_add(&addr->list, &iface->address);
+       list_add_tail(&addr->list, &iface->address);
        return system_add_address(iface->l3_iface->dev, addr);
 }
 
@@ -49,7 +49,7 @@ void interface_del_ctx_addr(struct interface *iface, void *ctx)
 
 int interface_add_route(struct interface *iface, struct device_route *route)
 {
-       list_add(&route->list, &iface->routes);
+       list_add_tail(&route->list, &iface->routes);
        return system_add_route(iface->l3_iface->dev, route);
 }
 
index c437ef35d7d2da5909536a68d4add3c82e8f6c98..20956be26bd0da9d61471dc0befa8997c3695f81 100644 (file)
@@ -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);