summaryrefslogtreecommitdiff
path: root/networking
diff options
context:
space:
mode:
authorEric Andersen2003-12-19 10:46:00 +0000
committerEric Andersen2003-12-19 10:46:00 +0000
commit658f8b1d1ae0e5d5d520d8ec120c8e087954d777 (patch)
treedd1f094383f4ce33cf9ffacf894b4e772cce6eda /networking
parentb8d2cd44a602b54814df034ac357c203d2781fb4 (diff)
downloadbusybox-658f8b1d1ae0e5d5d520d8ec120c8e087954d777.zip
busybox-658f8b1d1ae0e5d5d520d8ec120c8e087954d777.tar.gz
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.c18
1 files changed, 8 insertions, 10 deletions
diff --git a/networking/ifupdown.c b/networking/ifupdown.c
index 367aafa..bd0021a 100644
--- a/networking/ifupdown.c
+++ b/networking/ifupdown.c
@@ -1044,24 +1044,22 @@ static int check(char *str) {
static int iface_up(struct interface_defn_t *iface)
{
- int result;
if (!iface->method->up(iface,check)) return -1;
set_environ(iface, "start");
- result = execute_all(iface, doit, "pre-up");
- result += iface->method->up(iface, doit);
- result += execute_all(iface, doit, "up");
- return(result);
+ if (!execute_all(iface, doit, "pre-up")) return 0;
+ if (!iface->method->up(iface, doit)) return 0;
+ if (!execute_all(iface, doit, "up")) return 0;
+ return 1;
}
static int iface_down(struct interface_defn_t *iface)
{
- int result;
if (!iface->method->down(iface,check)) return -1;
set_environ(iface, "stop");
- result = execute_all(iface, doit, "down");
- result += iface->method->down(iface, doit);
- result += execute_all(iface, doit, "post-down");
- return(result);
+ if (!execute_all(iface, doit, "down")) return 0;
+ if (!iface->method->down(iface, doit)) return 0;
+ if (!execute_all(iface, doit, "post-down")) return 0;
+ return 1;
}
#ifdef CONFIG_FEATURE_IFUPDOWN_MAPPING