aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteven Barth <steven@midlink.org>2015-07-13 21:51:38 +0000
committerSteven Barth <steven@midlink.org>2015-07-13 21:51:38 +0000
commit9d9fa2f14739eb0e51d87b43d06966875da3fb51 (patch)
treec8e8c556f9dabb2e6ee03eb45274c6774fec59be
parent2f390bbe5f75f79e33f049e64f5cba553988894a (diff)
downloadmaster-187ad058-9d9fa2f14739eb0e51d87b43d06966875da3fb51.tar.gz
master-187ad058-9d9fa2f14739eb0e51d87b43d06966875da3fb51.tar.bz2
master-187ad058-9d9fa2f14739eb0e51d87b43d06966875da3fb51.zip
odhcp6c: fix some more compatibility issues
Signed-off-by: Steven Barth <steven@midlink.org> git-svn-id: svn://svn.openwrt.org/openwrt/trunk@46335 3c298f89-4303-0410-b956-a3cf2f4a3e73
-rwxr-xr-xpackage/network/ipv6/odhcp6c/files/dhcpv6.script15
1 files changed, 10 insertions, 5 deletions
diff --git a/package/network/ipv6/odhcp6c/files/dhcpv6.script b/package/network/ipv6/odhcp6c/files/dhcpv6.script
index 84eb706ebc..b8cbddb942 100755
--- a/package/network/ipv6/odhcp6c/files/dhcpv6.script
+++ b/package/network/ipv6/odhcp6c/files/dhcpv6.script
@@ -76,6 +76,7 @@ setup_interface () {
done
for entry in $RA_ROUTES; do
+ local duplicate=0
local addr="${entry%%/*}"
entry="${entry#*/}"
local mask="${entry%%,*}"
@@ -86,12 +87,16 @@ setup_interface () {
entry="${entry#*,}"
local metric="${entry%%,*}"
- if [ -z "$gw" ]; then
- proto_add_ipv6_route "$addr" "$mask" "$gw" "$metric" "$valid"
+ for xentry in $RA_ROUTES; do
+ local xprefix="${xentry%%,*}"
+ xentry="${xentry#*,}"
+ local xgw="${xentry%%,*}"
- # work around if there is a PIO matching a RIO
- # Linux seems to prefer source-dest over dest-only even if metric is higher
- proto_add_ipv6_route "$addr" "$mask" "$gw" "$metric" "$valid" "$addr/$mask"
+ [ -n "$gw" -a -z "$xgw" -a "$addr/$mask" = "$xprefix" ] && duplicate=1
+ done
+
+ if [ -z "$gw" -o "$duplicate" = 1 ]; then
+ proto_add_ipv6_route "$addr" "$mask" "$gw" "$metric" "$valid"
else
for prefix in $PREFIXES $ADDRESSES; do
local paddr="${prefix%%,*}"