diff options
-rw-r--r-- | networking/ifupdown.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/networking/ifupdown.c b/networking/ifupdown.c index 25b04c9d7..5c24451ba 100644 --- a/networking/ifupdown.c +++ b/networking/ifupdown.c | |||
@@ -492,7 +492,7 @@ static int FAST_FUNC static_up(struct interface_defn_t *ifd, execfn *exec) | |||
492 | result = execute("ifconfig %iface%[[ hw %hwaddress%]][[ media %media%]][[ mtu %mtu%]] up", | 492 | result = execute("ifconfig %iface%[[ hw %hwaddress%]][[ media %media%]][[ mtu %mtu%]] up", |
493 | ifd, exec); | 493 | ifd, exec); |
494 | result += execute("ifconfig %iface% %address% netmask %netmask%" | 494 | result += execute("ifconfig %iface% %address% netmask %netmask%" |
495 | "[[ broadcast %broadcast%]][[ pointopoint %pointopoint%]] ", | 495 | "[[ broadcast %broadcast%]][[ pointopoint %pointopoint%]]", |
496 | ifd, exec); | 496 | ifd, exec); |
497 | result += execute("[[route add default gw %gateway%[[ metric %metric%]] %iface%]]", ifd, exec); | 497 | result += execute("[[route add default gw %gateway%[[ metric %metric%]] %iface%]]", ifd, exec); |
498 | return ((result == 3) ? 3 : 0); | 498 | return ((result == 3) ? 3 : 0); |
@@ -503,7 +503,10 @@ static int FAST_FUNC static_down(struct interface_defn_t *ifd, execfn *exec) | |||
503 | { | 503 | { |
504 | int result; | 504 | int result; |
505 | # if ENABLE_FEATURE_IFUPDOWN_IP | 505 | # if ENABLE_FEATURE_IFUPDOWN_IP |
506 | result = execute("ip addr flush dev %iface%", ifd, exec); | 506 | /* Optional "label LBL" is necessary if interface is an alias (eth0:0), |
507 | * otherwise "ip addr flush dev eth0:0" flushes all addresses on eth0. | ||
508 | */ | ||
509 | result = execute("ip addr flush dev %iface%[[ label %label%]]", ifd, exec); | ||
507 | result += execute("ip link set %iface% down", ifd, exec); | 510 | result += execute("ip link set %iface% down", ifd, exec); |
508 | # else | 511 | # else |
509 | /* result = execute("[[route del default gw %gateway% %iface%]]", ifd, exec); */ | 512 | /* result = execute("[[route del default gw %gateway% %iface%]]", ifd, exec); */ |