aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorandersen <andersen@69ca8d6d-28ef-0310-b511-8ec308f3f277>2003-08-06 09:23:44 +0000
committerandersen <andersen@69ca8d6d-28ef-0310-b511-8ec308f3f277>2003-08-06 09:23:44 +0000
commit0c300e1fc9162bab5194a2d78bcbea5030b0e28f (patch)
treedb5e7b9cef9b60b031e9e98b01fdf3c96891ffac
parent6920acd7cee9d7de653db6c02c72a4cfce9e5a37 (diff)
downloadbusybox-w32-0c300e1fc9162bab5194a2d78bcbea5030b0e28f.tar.gz
busybox-w32-0c300e1fc9162bab5194a2d78bcbea5030b0e28f.tar.bz2
busybox-w32-0c300e1fc9162bab5194a2d78bcbea5030b0e28f.zip
Eric Spakman writes:
The attached patch adds "mtu" and "hwaddress" to the inet6 method and "mtu", "hwaddr" and "pointopoint" to the inet4 method (just like in the ifupdown part). Note: "hwaddress" can't be used with the busybox ip applet (this function isn't implemented in bb ip yet), but it can be of use with an external "full blown" ip package. The patch also removes "label" from the loopback configuration, labels (subinterfaces) aren't used with loopback interfaces. It further solves a problem in the bootp method, "ifconfig down %interface%" should be "ifconfig %interface% down" and it's now also possible to use ip with bootp. The patch is fully tested with both busybox ip and "stand-alone" ip and I didn't saw any problems. git-svn-id: svn://busybox.net/trunk/busybox@7175 69ca8d6d-28ef-0310-b511-8ec308f3f277
-rw-r--r--networking/ifupdown.c18
1 files changed, 11 insertions, 7 deletions
diff --git a/networking/ifupdown.c b/networking/ifupdown.c
index bae9f4ea4..afeec363a 100644
--- a/networking/ifupdown.c
+++ b/networking/ifupdown.c
@@ -388,7 +388,7 @@ static int loopback_up6(struct interface_defn_t *ifd, execfn *exec)
388{ 388{
389#ifdef CONFIG_FEATURE_IFUPDOWN_IP 389#ifdef CONFIG_FEATURE_IFUPDOWN_IP
390 int result; 390 int result;
391 result =execute("ip addr add ::1 dev %iface% label %label%", ifd, exec); 391 result =execute("ip addr add ::1 dev %iface%", ifd, exec);
392 result += execute("ip link set %iface% up", ifd, exec); 392 result += execute("ip link set %iface% up", ifd, exec);
393 return( result); 393 return( result);
394#else 394#else
@@ -409,8 +409,8 @@ static int static_up6(struct interface_defn_t *ifd, execfn *exec)
409{ 409{
410 int result; 410 int result;
411#ifdef CONFIG_FEATURE_IFUPDOWN_IP 411#ifdef CONFIG_FEATURE_IFUPDOWN_IP
412 result = execute("ip addr add %address%/%netmask% dev %iface% label %label%", ifd, exec); 412 result = execute("ip addr add %address%/%netmask% dev %iface% [[label %label%]]", ifd, exec);
413 result += execute("ip link set %iface% up", ifd, exec); 413 result += execute("ip link set [[mtu %mtu%]] [[address %hwaddress%]] %iface% up", ifd, exec);
414 result += execute("[[ ip route add ::/0 via %gateway% ]]", ifd, exec); 414 result += execute("[[ ip route add ::/0 via %gateway% ]]", ifd, exec);
415#else 415#else
416 result = execute("ifconfig %iface% [[media %media%]] [[hw %hwaddress%]] [[mtu %mtu%]] up", ifd, exec); 416 result = execute("ifconfig %iface% [[media %media%]] [[hw %hwaddress%]] [[mtu %mtu%]] up", ifd, exec);
@@ -467,7 +467,7 @@ static int loopback_up(struct interface_defn_t *ifd, execfn *exec)
467{ 467{
468#ifdef CONFIG_FEATURE_IFUPDOWN_IP 468#ifdef CONFIG_FEATURE_IFUPDOWN_IP
469 int result; 469 int result;
470 result = execute("ip addr add 127.0.0.1/8 dev %iface% label %label%", ifd, exec); 470 result = execute("ip addr add 127.0.0.1/8 dev %iface%", ifd, exec);
471 result += execute("ip link set %iface% up", ifd, exec); 471 result += execute("ip link set %iface% up", ifd, exec);
472 return(result); 472 return(result);
473#else 473#else
@@ -492,8 +492,8 @@ static int static_up(struct interface_defn_t *ifd, execfn *exec)
492 int result; 492 int result;
493#ifdef CONFIG_FEATURE_IFUPDOWN_IP 493#ifdef CONFIG_FEATURE_IFUPDOWN_IP
494 result = execute("ip addr add %address%/%bnmask% [[broadcast %broadcast%]] " 494 result = execute("ip addr add %address%/%bnmask% [[broadcast %broadcast%]] "
495 "dev %iface% label %label%", ifd, exec); 495 "dev %iface% [[peer %pointopoint%]] [[label %label%]]", ifd, exec);
496 result += execute("ip link set %iface% up", ifd, exec); 496 result += execute("ip link set [[mtu %mtu%]] [[address %hwaddress%]] %iface% up", ifd, exec);
497 result += execute("[[ ip route add default via %gateway% dev %iface% ]]", ifd, exec); 497 result += execute("[[ ip route add default via %gateway% dev %iface% ]]", ifd, exec);
498#else 498#else
499 result = execute("ifconfig %iface% %address% netmask %netmask% " 499 result = execute("ifconfig %iface% %address% netmask %netmask% "
@@ -569,7 +569,11 @@ static int bootp_up(struct interface_defn_t *ifd, execfn *exec)
569 569
570static int bootp_down(struct interface_defn_t *ifd, execfn *exec) 570static int bootp_down(struct interface_defn_t *ifd, execfn *exec)
571{ 571{
572 return( execute("ifconfig down %iface%", ifd, exec)); 572#ifdef CONFIG_FEATURE_IFUPDOWN_IP
573 return(execute("ip link set %iface% down", ifd, exec));
574#else
575 return(execute("ifconfig %iface% down", ifd, exec));
576#endif
573} 577}
574 578
575static int ppp_up(struct interface_defn_t *ifd, execfn *exec) 579static int ppp_up(struct interface_defn_t *ifd, execfn *exec)