projects
/
project
/
netifd.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
49bf494
)
properly flush routes and l3 devices when tearing down interfaces
author
Felix Fietkau
<nbd@openwrt.org>
Mon, 19 Mar 2012 21:04:03 +0000
(22:04 +0100)
committer
Felix Fietkau
<nbd@openwrt.org>
Mon, 19 Mar 2012 21:04:03 +0000
(22:04 +0100)
interface.c
patch
|
blob
|
history
proto-shell.c
patch
|
blob
|
history
diff --git
a/interface.c
b/interface.c
index
4d9aa8a
..
4ad89f5
100644
(file)
--- a/
interface.c
+++ b/
interface.c
@@
-120,6
+120,8
@@
__interface_set_down(struct interface *iface, bool force)
if (iface->state == IFS_UP)
interface_event(iface, IFEV_DOWN);
iface->state = IFS_TEARDOWN;
if (iface->state == IFS_UP)
interface_event(iface, IFEV_DOWN);
iface->state = IFS_TEARDOWN;
+ interface_ip_flush(&iface->config_ip);
+ interface_ip_flush(&iface->proto_ip);
interface_proto_event(iface->proto, PROTO_CMD_TEARDOWN, force);
if (force)
interface_flush_state(iface);
interface_proto_event(iface->proto, PROTO_CMD_TEARDOWN, force);
if (force)
interface_flush_state(iface);
diff --git
a/proto-shell.c
b/proto-shell.c
index
2239b49
..
8238c0d
100644
(file)
--- 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->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);
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);
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);
netifd_kill_process(&state->script_task);
netifd_kill_process(&state->proto_task);
free(state->config);