add an install target
[project/netifd.git] / proto-shell.c
index 7eeff28..65ade12 100644 (file)
@@ -1,3 +1,5 @@
+#define _GNU_SOURCE
+
 #include <string.h>
 #include <stdlib.h>
 #include <stdio.h>
@@ -138,9 +140,11 @@ proto_shell_teardown_cb(struct uloop_process *p, int ret)
        struct proto_shell_state *state;
 
        state = container_of(p, struct proto_shell_state, teardown_task);
-       state->proto.proto_event(&state->proto, IFPEV_DOWN);
+
        if (state->l3_dev.dev)
                device_remove_user(&state->l3_dev);
+
+       state->proto.proto_event(&state->proto, IFPEV_DOWN);
 }
 
 static void