diff options
| author | Eric Andersen <andersen@codepoet.org> | 2004-07-30 14:31:01 +0000 |
|---|---|---|
| committer | Eric Andersen <andersen@codepoet.org> | 2004-07-30 14:31:01 +0000 |
| commit | 373bc1eaee19fa044bd6e32e7851948e37330385 (patch) | |
| tree | 5eaa97e63c85013d328bcd1755d3c1e4d15360a5 | |
| parent | 413db4d583805badc686362705b5ea34555fffd7 (diff) | |
| download | busybox-w32-373bc1eaee19fa044bd6e32e7851948e37330385.tar.gz busybox-w32-373bc1eaee19fa044bd6e32e7851948e37330385.tar.bz2 busybox-w32-373bc1eaee19fa044bd6e32e7851948e37330385.zip | |
As noted by Eric Spakman, calling static_down() and then calling
bootp_down() seems redundant, esp since bootp_down was a subset
of static_down, so just use that...
| -rw-r--r-- | networking/ifupdown.c | 18 |
1 files changed, 4 insertions, 14 deletions
diff --git a/networking/ifupdown.c b/networking/ifupdown.c index 95d78ea46..f703a5d87 100644 --- a/networking/ifupdown.c +++ b/networking/ifupdown.c | |||
| @@ -551,21 +551,12 @@ static int dhcp_up(struct interface_defn_t *ifd, execfn *exec) | |||
| 551 | return(0); | 551 | return(0); |
| 552 | } | 552 | } |
| 553 | 553 | ||
| 554 | static int bootp_down(struct interface_defn_t *ifd, execfn *exec) | ||
| 555 | { | ||
| 556 | #ifdef CONFIG_FEATURE_IFUPDOWN_IP | ||
| 557 | return(execute("ip link set %iface% down", ifd, exec)); | ||
| 558 | #else | ||
| 559 | return(execute("ifconfig %iface% down", ifd, exec)); | ||
| 560 | #endif | ||
| 561 | } | ||
| 562 | |||
| 563 | static int dhcp_down(struct interface_defn_t *ifd, execfn *exec) | 554 | static int dhcp_down(struct interface_defn_t *ifd, execfn *exec) |
| 564 | { | 555 | { |
| 565 | int result = 0; | 556 | int result = 0; |
| 566 | if (execable("/sbin/udhcpc")) { | 557 | if (execable("/sbin/udhcpc")) { |
| 567 | execute("kill -USR2 `cat /var/run/udhcpc.%iface%.pid` 2>/dev/null", ifd, exec); | 558 | result = execute("kill -USR2 `cat /var/run/udhcpc.%iface%.pid` 2>/dev/null", ifd, exec); |
| 568 | execute("kill -9 `cat /var/run/udhcpc.%iface%.pid` 2>/dev/null", ifd, exec); | 559 | result += execute("kill -9 `cat /var/run/udhcpc.%iface%.pid` 2>/dev/null", ifd, exec); |
| 569 | } else if (execable("/sbin/pump")) { | 560 | } else if (execable("/sbin/pump")) { |
| 570 | result = execute("pump -i %iface% -k", ifd, exec); | 561 | result = execute("pump -i %iface% -k", ifd, exec); |
| 571 | } else if (execable("/sbin/dhclient")) { | 562 | } else if (execable("/sbin/dhclient")) { |
| @@ -573,8 +564,7 @@ static int dhcp_down(struct interface_defn_t *ifd, execfn *exec) | |||
| 573 | } else if (execable("/sbin/dhcpcd")) { | 564 | } else if (execable("/sbin/dhcpcd")) { |
| 574 | result = execute("dhcpcd -k %iface%", ifd, exec); | 565 | result = execute("dhcpcd -k %iface%", ifd, exec); |
| 575 | } | 566 | } |
| 576 | static_down(ifd, exec); | 567 | return (result || static_down(ifd, exec)); |
| 577 | return (result || bootp_down(ifd, exec)); | ||
| 578 | } | 568 | } |
| 579 | 569 | ||
| 580 | static int bootp_up(struct interface_defn_t *ifd, execfn *exec) | 570 | static int bootp_up(struct interface_defn_t *ifd, execfn *exec) |
| @@ -611,7 +601,7 @@ static struct method_t methods[] = | |||
| 611 | { "wvdial", wvdial_up, wvdial_down, }, | 601 | { "wvdial", wvdial_up, wvdial_down, }, |
| 612 | { "ppp", ppp_up, ppp_down, }, | 602 | { "ppp", ppp_up, ppp_down, }, |
| 613 | { "static", static_up, static_down, }, | 603 | { "static", static_up, static_down, }, |
| 614 | { "bootp", bootp_up, bootp_down, }, | 604 | { "bootp", bootp_up, static_down, }, |
| 615 | { "dhcp", dhcp_up, dhcp_down, }, | 605 | { "dhcp", dhcp_up, dhcp_down, }, |
| 616 | { "loopback", loopback_up, loopback_down, }, | 606 | { "loopback", loopback_up, loopback_down, }, |
| 617 | }; | 607 | }; |
