From: Felix Fietkau Date: Sun, 11 Sep 2011 09:15:39 +0000 (+0200) Subject: bring all interfaces down on restart X-Git-Url: http://git.archive.openwrt.org/?p=project%2Fnetifd.git;a=commitdiff_plain;h=a323f3adf275954727f32895eea37bfcf0aa9fb7;ds=sidebyside bring all interfaces down on restart --- diff --git a/interface.c b/interface.c index 705bdd3..4b22807 100644 --- a/interface.c +++ b/interface.c @@ -312,8 +312,13 @@ interface_set_up(struct interface *iface) int interface_set_down(struct interface *iface) { - iface->autostart = false; - __interface_set_down(iface, false); + if (!iface) { + list_for_each_entry(iface, &interfaces, list) + __interface_set_down(iface, false); + } else { + iface->autostart = false; + __interface_set_down(iface, false); + } return 0; } diff --git a/main.c b/main.c index da5ae09..7d7bfcb 100644 --- a/main.c +++ b/main.c @@ -6,6 +6,7 @@ #include "netifd.h" #include "ubus.h" #include "config.h" +#include "interface.h" const char *main_path = "."; static char **global_argv; @@ -21,6 +22,7 @@ static struct uloop_timeout restart_timer = { void netifd_restart(void) { + interface_set_down(NULL); uloop_timeout_set(&restart_timer, 1000); }