interface: call proto teardown before marking the interface as down
authorFelix Fietkau <nbd@openwrt.org>
Sun, 31 Aug 2014 13:06:42 +0000 (15:06 +0200)
committerFelix Fietkau <nbd@openwrt.org>
Sun, 31 Aug 2014 13:06:48 +0000 (15:06 +0200)
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
interface.c

index bebc30be9275ca5f78cd096c2daac8a20c41b1e6..35f20b087fdee2906296cb29cbbf65045a34d9ea 100644 (file)
@@ -272,8 +272,8 @@ interface_check_state(struct interface *iface)
        switch (iface->state) {
        case IFS_UP:
                if (!iface->enabled || !link_state) {
-                       mark_interface_down(iface);
                        interface_proto_event(iface->proto, PROTO_CMD_TEARDOWN, false);
+                       mark_interface_down(iface);
                }
                break;
        case IFS_DOWN: