diff options
-rw-r--r-- | networking/ifupdown.c | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/networking/ifupdown.c b/networking/ifupdown.c index 367aafa05..bd0021ab4 100644 --- a/networking/ifupdown.c +++ b/networking/ifupdown.c | |||
@@ -1044,24 +1044,22 @@ static int check(char *str) { | |||
1044 | 1044 | ||
1045 | static int iface_up(struct interface_defn_t *iface) | 1045 | static int iface_up(struct interface_defn_t *iface) |
1046 | { | 1046 | { |
1047 | int result; | ||
1048 | if (!iface->method->up(iface,check)) return -1; | 1047 | if (!iface->method->up(iface,check)) return -1; |
1049 | set_environ(iface, "start"); | 1048 | set_environ(iface, "start"); |
1050 | result = execute_all(iface, doit, "pre-up"); | 1049 | if (!execute_all(iface, doit, "pre-up")) return 0; |
1051 | result += iface->method->up(iface, doit); | 1050 | if (!iface->method->up(iface, doit)) return 0; |
1052 | result += execute_all(iface, doit, "up"); | 1051 | if (!execute_all(iface, doit, "up")) return 0; |
1053 | return(result); | 1052 | return 1; |
1054 | } | 1053 | } |
1055 | 1054 | ||
1056 | static int iface_down(struct interface_defn_t *iface) | 1055 | static int iface_down(struct interface_defn_t *iface) |
1057 | { | 1056 | { |
1058 | int result; | ||
1059 | if (!iface->method->down(iface,check)) return -1; | 1057 | if (!iface->method->down(iface,check)) return -1; |
1060 | set_environ(iface, "stop"); | 1058 | set_environ(iface, "stop"); |
1061 | result = execute_all(iface, doit, "down"); | 1059 | if (!execute_all(iface, doit, "down")) return 0; |
1062 | result += iface->method->down(iface, doit); | 1060 | if (!iface->method->down(iface, doit)) return 0; |
1063 | result += execute_all(iface, doit, "post-down"); | 1061 | if (!execute_all(iface, doit, "post-down")) return 0; |
1064 | return(result); | 1062 | return 1; |
1065 | } | 1063 | } |
1066 | 1064 | ||
1067 | #ifdef CONFIG_FEATURE_IFUPDOWN_MAPPING | 1065 | #ifdef CONFIG_FEATURE_IFUPDOWN_MAPPING |