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 bebc30b..35f20b0 100644 (file)
@@ -272,8 +272,8 @@ interface_check_state(struct interface *iface)
        switch (iface->state) {
        case IFS_UP:
                if (!iface->enabled || !link_state) {
        switch (iface->state) {
        case IFS_UP:
                if (!iface->enabled || !link_state) {
-                       mark_interface_down(iface);
                        interface_proto_event(iface->proto, PROTO_CMD_TEARDOWN, false);
                        interface_proto_event(iface->proto, PROTO_CMD_TEARDOWN, false);
+                       mark_interface_down(iface);
                }
                break;
        case IFS_DOWN:
                }
                break;
        case IFS_DOWN: