diff options
author | Felix Fietkau <nbd@openwrt.org> | 2012-03-19 22:04:03 +0100 |
---|---|---|
committer | Felix Fietkau <nbd@openwrt.org> | 2012-03-19 22:04:03 +0100 |
commit | 75baeca6f817b161f522a9961bfe5c3718397189 (patch) | |
tree | be038d439c83b33e88450aa3561f6ad55eb375ca /proto-shell.c | |
parent | 49bf4946296b22f7c26594ac310879d6059344d4 (diff) |
properly flush routes and l3 devices when tearing down interfaces
Diffstat (limited to 'proto-shell.c')
-rw-r--r-- | proto-shell.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/proto-shell.c b/proto-shell.c index 2239b49..8238c0d 100644 --- a/proto-shell.c +++ b/proto-shell.c @@ -79,6 +79,9 @@ proto_shell_handler(struct interface_proto_state *proto, if (state->sm == S_TEARDOWN) return 0; + if (state->l3_dev.dev) + device_remove_user(&state->l3_dev); + if (state->script_task.uloop.pending) { if (state->sm != S_SETUP_ABORT) { uloop_timeout_set(&state->teardown_timeout, 1000); @@ -201,6 +204,8 @@ proto_shell_free(struct interface_proto_state *proto) struct proto_shell_state *state; state = container_of(proto, struct proto_shell_state, proto); + if (state->l3_dev.dev) + device_remove_user(&state->l3_dev); netifd_kill_process(&state->script_task); netifd_kill_process(&state->proto_task); free(state->config); |