clear all remaining addresses on interface down
authorFelix Fietkau <nbd@openwrt.org>
Mon, 2 May 2011 20:20:30 +0000 (22:20 +0200)
committerFelix Fietkau <nbd@openwrt.org>
Mon, 2 May 2011 20:20:30 +0000 (22:20 +0200)
interface-ip.c
interface.c

index 20df281af886875405c3ee335653177e32c8652e..797be584c5a0de3dbad1ed731762ea97b26d0381 100644 (file)
@@ -40,7 +40,7 @@ void interface_del_ctx_addr(struct interface *iface, void *ctx)
        struct interface_addr *addr, *tmp;
 
        list_for_each_entry_safe(addr, tmp, &iface->address, list) {
-               if (addr->ctx != ctx)
+               if (ctx && addr->ctx != ctx)
                        continue;
 
                interface_del_address(iface, addr);
index 88cf6824fcc04c12da32b346a39e0b9fd5259e11..0a53151c5a33959430c07ef3f1e5ef330e100283 100644 (file)
@@ -64,6 +64,7 @@ interface_event(struct interface *iface, enum interface_event ev)
 static void
 mark_interface_down(struct interface *iface)
 {
+       interface_del_ctx_addr(iface, NULL);
        release_device(iface->main_dev.dev);
        iface->state = IFS_DOWN;
 }