aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorandersen <andersen@69ca8d6d-28ef-0310-b511-8ec308f3f277>2004-07-30 14:31:01 +0000
committerandersen <andersen@69ca8d6d-28ef-0310-b511-8ec308f3f277>2004-07-30 14:31:01 +0000
commit5881c6354943c9f9d34af931af8e61792707d944 (patch)
tree5eaa97e63c85013d328bcd1755d3c1e4d15360a5
parent1ac5cd89b7bc6d542c2a1130f1c479558c42634b (diff)
downloadbusybox-w32-5881c6354943c9f9d34af931af8e61792707d944.tar.gz
busybox-w32-5881c6354943c9f9d34af931af8e61792707d944.tar.bz2
busybox-w32-5881c6354943c9f9d34af931af8e61792707d944.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... git-svn-id: svn://busybox.net/trunk/busybox@9044 69ca8d6d-28ef-0310-b511-8ec308f3f277
-rw-r--r--networking/ifupdown.c18
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
554static 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
563static int dhcp_down(struct interface_defn_t *ifd, execfn *exec) 554static 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
580static int bootp_up(struct interface_defn_t *ifd, execfn *exec) 570static 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};