diff options
author | Denis Vlasenko <vda.linux@googlemail.com> | 2007-07-21 14:57:54 +0000 |
---|---|---|
committer | Denis Vlasenko <vda.linux@googlemail.com> | 2007-07-21 14:57:54 +0000 |
commit | 6cd84dac84f72dde437790cc620c8638d3591d00 (patch) | |
tree | 1c822ba1859d04ab9af79210d7f331207738ed7b /networking/ifupdown.c | |
parent | e8feca085dbcd0fb97aa5af1a8e751affb88df48 (diff) | |
download | busybox-w32-6cd84dac84f72dde437790cc620c8638d3591d00.tar.gz busybox-w32-6cd84dac84f72dde437790cc620c8638d3591d00.tar.bz2 busybox-w32-6cd84dac84f72dde437790cc620c8638d3591d00.zip |
Three patches from FreeWRT people
Diffstat (limited to '')
-rw-r--r-- | networking/ifupdown.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/networking/ifupdown.c b/networking/ifupdown.c index 5aa3fa5f1..a15e1411e 100644 --- a/networking/ifupdown.c +++ b/networking/ifupdown.c | |||
@@ -484,7 +484,12 @@ static const struct dhcp_client_t ext_dhcp_clients[] = { | |||
484 | static int dhcp_up(struct interface_defn_t *ifd, execfn *exec) | 484 | static int dhcp_up(struct interface_defn_t *ifd, execfn *exec) |
485 | { | 485 | { |
486 | #if ENABLE_FEATURE_IFUPDOWN_EXTERNAL_DHCP | 486 | #if ENABLE_FEATURE_IFUPDOWN_EXTERNAL_DHCP |
487 | int i ; | 487 | #if ENABLE_FEATURE_IFUPDOWN_IP |
488 | /* ip doesn't up iface when it configures it (unlike ifconfig) */ | ||
489 | if (!execute("ip link set %iface% up", ifd, exec)) | ||
490 | return 0; | ||
491 | #endif | ||
492 | int i; | ||
488 | for (i = 0; i < ARRAY_SIZE(ext_dhcp_clients); i++) { | 493 | for (i = 0; i < ARRAY_SIZE(ext_dhcp_clients); i++) { |
489 | if (exists_execable(ext_dhcp_clients[i].name)) | 494 | if (exists_execable(ext_dhcp_clients[i].name)) |
490 | return execute(ext_dhcp_clients[i].startcmd, ifd, exec); | 495 | return execute(ext_dhcp_clients[i].startcmd, ifd, exec); |
@@ -492,6 +497,11 @@ static int dhcp_up(struct interface_defn_t *ifd, execfn *exec) | |||
492 | bb_error_msg("no dhcp clients found"); | 497 | bb_error_msg("no dhcp clients found"); |
493 | return 0; | 498 | return 0; |
494 | #elif ENABLE_APP_UDHCPC | 499 | #elif ENABLE_APP_UDHCPC |
500 | #if ENABLE_FEATURE_IFUPDOWN_IP | ||
501 | /* ip doesn't up iface when it configures it (unlike ifconfig) */ | ||
502 | if (!execute("ip link set %iface% up", ifd, exec)) | ||
503 | return 0; | ||
504 | #endif | ||
495 | return execute("udhcpc -R -n -p /var/run/udhcpc.%iface%.pid " | 505 | return execute("udhcpc -R -n -p /var/run/udhcpc.%iface%.pid " |
496 | "-i %iface%[[ -H %hostname%]][[ -c %clientid%]][[ -s %script%]]", | 506 | "-i %iface%[[ -H %hostname%]][[ -c %clientid%]][[ -s %script%]]", |
497 | ifd, exec); | 507 | ifd, exec); |
@@ -503,7 +513,7 @@ static int dhcp_up(struct interface_defn_t *ifd, execfn *exec) | |||
503 | static int dhcp_down(struct interface_defn_t *ifd, execfn *exec) | 513 | static int dhcp_down(struct interface_defn_t *ifd, execfn *exec) |
504 | { | 514 | { |
505 | #if ENABLE_FEATURE_IFUPDOWN_EXTERNAL_DHCP | 515 | #if ENABLE_FEATURE_IFUPDOWN_EXTERNAL_DHCP |
506 | int i ; | 516 | int i; |
507 | for (i = 0; i < ARRAY_SIZE(ext_dhcp_clients); i++) { | 517 | for (i = 0; i < ARRAY_SIZE(ext_dhcp_clients); i++) { |
508 | if (exists_execable(ext_dhcp_clients[i].name)) | 518 | if (exists_execable(ext_dhcp_clients[i].name)) |
509 | return execute(ext_dhcp_clients[i].stopcmd, ifd, exec); | 519 | return execute(ext_dhcp_clients[i].stopcmd, ifd, exec); |