alias: set ifindex on alias device to fix setting addresses/routes
authorFelix Fietkau <nbd@openwrt.org>
Mon, 28 Jan 2013 20:33:05 +0000 (21:33 +0100)
committerFelix Fietkau <nbd@openwrt.org>
Mon, 28 Jan 2013 20:33:18 +0000 (21:33 +0100)
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
alias.c

diff --git a/alias.c b/alias.c
index 185a5d25b3a37908ec142c41cac4861853c43720..4e0a6be0d7fb78659e0f9f4f5aa5bf3bea061a94 100644 (file)
--- a/alias.c
+++ b/alias.c
@@ -51,6 +51,7 @@ static void alias_set_device(struct alias_device *alias, struct device *dev)
        device_remove_user(&alias->dep);
        alias->dev.hidden = !dev;
        if (dev) {
+               alias->dev.ifindex = dev->ifindex;
                strcpy(alias->dev.ifname, dev->ifname);
                device_broadcast_event(&alias->dev, DEV_EVENT_UPDATE_IFNAME);
                device_add_user(&alias->dep, dev);