aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTimo Teräs <timo.teras@iki.fi>2015-10-26 17:06:12 +0100
committerDenys Vlasenko <vda.linux@googlemail.com>2015-10-26 17:06:12 +0100
commit028524317d8d0011ed38e86e507a06738a5b5a97 (patch)
treedb8bd549f9a6886298cfc5afb2f4bee45ad7fc20
parentdb700330d8951d96ea70102797041730c925eeeb (diff)
downloadbusybox-028524317d8d0011ed38e86e507a06738a5b5a97.tar.gz
ifupdown: pass interface device name for ipv6 route commands
IPv6 routes need the device argument for link-local routes, or they cannot be used at all. E.g. "gateway fe80::def" seems to be used in some places, but kernel refuses to insert the route unless device name is explicitly specified in the route addition. Signed-off-by: Timo Teräs <timo.teras@iki.fi> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
-rw-r--r--networking/ifupdown.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/networking/ifupdown.c b/networking/ifupdown.c
index 7c45e8927..d477ff6d1 100644
--- a/networking/ifupdown.c
+++ b/networking/ifupdown.c
@@ -394,8 +394,8 @@ static int FAST_FUNC static_up6(struct interface_defn_t *ifd, execfn *exec)
# if ENABLE_FEATURE_IFUPDOWN_IP
result = execute("ip addr add %address%/%netmask% dev %iface%[[ label %label%]]", ifd, exec);
result += execute("ip link set[[ mtu %mtu%]][[ addr %hwaddress%]] %iface% up", ifd, exec);
- /* Was: "[[ ip ....%gateway% ]]". Removed extra spaces w/o checking */
- result += execute("[[ip route add ::/0 via %gateway%]][[ metric %metric%]]", ifd, exec);
+ /* Reportedly, IPv6 needs "dev %iface%", but IPv4 does not: */
+ result += execute("[[ip route add ::/0 via %gateway% dev %iface%]][[ metric %metric%]]", ifd, exec);
# else
result = execute("ifconfig %iface%[[ media %media%]][[ hw %hwaddress%]][[ mtu %mtu%]] up", ifd, exec);
result += execute("ifconfig %iface% add %address%/%netmask%", ifd, exec);
@@ -421,7 +421,8 @@ static int FAST_FUNC v4tunnel_up(struct interface_defn_t *ifd, execfn *exec)
"%endpoint%[[ local %local%]][[ ttl %ttl%]]", ifd, exec);
result += execute("ip link set %iface% up", ifd, exec);
result += execute("ip addr add %address%/%netmask% dev %iface%", ifd, exec);
- result += execute("[[ip route add ::/0 via %gateway%]]", ifd, exec);
+ /* Reportedly, IPv6 needs "dev %iface%", but IPv4 does not: */
+ result += execute("[[ip route add ::/0 via %gateway% dev %iface%]]", ifd, exec);
return ((result == 4) ? 4 : 0);
}