diff options
author | Felix Fietkau <nbd@openwrt.org> | 2013-04-25 18:27:20 +0200 |
---|---|---|
committer | Felix Fietkau <nbd@openwrt.org> | 2013-04-25 18:27:20 +0200 |
commit | b92d7fe66abb453619b996155b27641c5ce77276 (patch) | |
tree | d1110e453f344ab23a8d28154f0ccc797632ee29 | |
parent | 57419bcad1d86c41e906ce2adda33516881cb9f1 (diff) |
interface: fix removing main_dev on config reload changes if ifname is reset to NULL
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
-rw-r--r-- | interface.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/interface.c b/interface.c index 3a8fd34..a2c3f44 100644 --- a/interface.c +++ b/interface.c @@ -328,9 +328,14 @@ interface_claim_device(struct interface *iface) static void interface_cleanup_state(struct interface *iface) { + interface_set_available(iface, false); + interface_flush_state(iface); interface_clear_errors(iface); interface_set_proto_state(iface, NULL); + + if (iface->main_dev.dev) + interface_set_main_dev(iface, NULL); } static void @@ -345,9 +350,6 @@ interface_cleanup(struct interface *iface) interface_remove_user(dep); interface_ip_flush(&iface->config_ip); - if (iface->main_dev.dev) - interface_set_main_dev(iface, NULL); - interface_cleanup_state(iface); } |