From: Lauri Hintsala Date: Wed, 14 Dec 2011 14:49:58 +0000 (+0200) Subject: ifupdown: remove interface from state_list if iface_up fails X-Git-Tag: 1_20_0~124 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=454fe29a802f5f32b802df1a54324946d0b87669;p=oweals%2Fbusybox.git ifupdown: remove interface from state_list if iface_up fails Fix the issue where interface is set to the configured state even if configuration has failed. Add error check to state setting logic. Signed-off-by: Lauri Hintsala Signed-off-by: Denys Vlasenko --- diff --git a/networking/ifupdown.c b/networking/ifupdown.c index 5946323d0..9c2cad231 100644 --- a/networking/ifupdown.c +++ b/networking/ifupdown.c @@ -1311,7 +1311,7 @@ int ifupdown_main(int argc UNUSED_PARAM, char **argv) llist_t *state_list = read_iface_state(); llist_t *iface_state = find_iface_state(state_list, iface); - if (cmds == iface_up) { + if (cmds == iface_up && !any_failures) { char * const newiface = xasprintf("%s=%s", iface, liface); if (iface_state == NULL) { llist_add_to_end(&state_list, newiface);