diff options
author | Eric Andersen <andersen@codepoet.org> | 2003-12-19 10:46:00 +0000 |
---|---|---|
committer | Eric Andersen <andersen@codepoet.org> | 2003-12-19 10:46:00 +0000 |
commit | 658f8b1d1ae0e5d5d520d8ec120c8e087954d777 (patch) | |
tree | dd1f094383f4ce33cf9ffacf894b4e772cce6eda /networking | |
parent | b8d2cd44a602b54814df034ac357c203d2781fb4 (diff) | |
download | busybox-w32-658f8b1d1ae0e5d5d520d8ec120c8e087954d777.tar.gz busybox-w32-658f8b1d1ae0e5d5d520d8ec120c8e087954d777.tar.bz2 busybox-w32-658f8b1d1ae0e5d5d520d8ec120c8e087954d777.zip |
Manousaridis Angelos writes:
Hello,
I have been using busybox for some time now, for an ARM based platform.
I was very pleased when I tried the 1.00preX series, with all the new
utilities and daemons.
I found out that the ifupdown in busybox does not behave exaclty like
the debian version. Then the pre-up script fails, the interface is
getting up. Also when the post-up script fails the return value is
ignored. Actually everything is always run and the return value is
always true. I looked at the original implementation from debian and
fixed the busybox version to do the same. A patch is attached if anyone
is interested.
Diffstat (limited to 'networking')
-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 |