ifupdown: remove interface from state_list if iface_up fails
authorLauri Hintsala <lauri.hintsala@bluegiga.com>
Wed, 14 Dec 2011 14:49:58 +0000 (16:49 +0200)
committerDenys Vlasenko <vda.linux@googlemail.com>
Thu, 15 Dec 2011 11:33:39 +0000 (12:33 +0100)
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 <lauri.hintsala@bluegiga.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
networking/ifupdown.c

index 5946323d0ea5bf9773ea435284fd82c02f367b3d..9c2cad231077c3dfaab932f6578d90fd59cbd3b3 100644 (file)
@@ -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);