interface: clean up l3 device reference on remove/reload
authorFelix Fietkau <nbd@openwrt.org>
Sun, 29 Jun 2014 21:27:29 +0000 (23:27 +0200)
committerFelix Fietkau <nbd@openwrt.org>
Sun, 29 Jun 2014 21:27:36 +0000 (23:27 +0200)
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
interface.c

index 1f83be32f5a0b269e314632005cb41a2b43ad505..ea252083ae1ea48c404cea7280660175994c134c 100644 (file)
@@ -509,8 +509,8 @@ interface_cleanup_state(struct interface *iface)
        interface_clear_errors(iface);
        interface_set_proto_state(iface, NULL);
 
-       if (iface->main_dev.dev)
-               interface_set_main_dev(iface, NULL);
+       interface_set_main_dev(iface, NULL);
+       interface_set_l3_dev(iface, NULL);
 }
 
 static void