flush interface ip state after the interface has been brought down, fixes ppp default...
authorFelix Fietkau <nbd@openwrt.org>
Thu, 12 Apr 2012 13:59:29 +0000 (15:59 +0200)
committerFelix Fietkau <nbd@openwrt.org>
Thu, 12 Apr 2012 13:59:29 +0000 (15:59 +0200)
interface.c

index 0aa5c5a..b7c33b7 100644 (file)
@@ -143,6 +143,8 @@ mark_interface_down(struct interface *iface)
        if (iface->state == IFS_UP)
                interface_event(iface, IFEV_DOWN);
        interface_flush_state(iface);
+       interface_ip_flush(&iface->config_ip);
+       interface_ip_flush(&iface->proto_ip);
        iface->state = IFS_DOWN;
 }
 
@@ -158,8 +160,6 @@ __interface_set_down(struct interface *iface, bool force)
        if (iface->state == IFS_UP)
                interface_event(iface, IFEV_DOWN);
        iface->state = IFS_TEARDOWN;
-       interface_ip_flush(&iface->config_ip);
-       interface_ip_flush(&iface->proto_ip);
        interface_proto_event(iface->proto, PROTO_CMD_TEARDOWN, force);
        if (force)
                interface_flush_state(iface);