From a323f3adf275954727f32895eea37bfcf0aa9fb7 Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Sun, 11 Sep 2011 11:15:39 +0200 Subject: [PATCH] bring all interfaces down on restart --- interface.c | 9 +++++++-- main.c | 2 ++ 2 files changed, 9 insertions(+), 2 deletions(-) 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); } -- 2.25.1