odhcp6c: fix some more compatibility issues

Signed-off-by: Steven Barth <steven@midlink.org>

SVN-Revision: 46335
This commit is contained in:
Steven Barth 2015-07-13 21:51:38 +00:00
parent fab6209f71
commit a06c1c810e

View File

@ -76,6 +76,7 @@ setup_interface () {
done done
for entry in $RA_ROUTES; do for entry in $RA_ROUTES; do
local duplicate=0
local addr="${entry%%/*}" local addr="${entry%%/*}"
entry="${entry#*/}" entry="${entry#*/}"
local mask="${entry%%,*}" local mask="${entry%%,*}"
@ -86,12 +87,16 @@ setup_interface () {
entry="${entry#*,}" entry="${entry#*,}"
local metric="${entry%%,*}" local metric="${entry%%,*}"
if [ -z "$gw" ]; then for xentry in $RA_ROUTES; do
proto_add_ipv6_route "$addr" "$mask" "$gw" "$metric" "$valid" local xprefix="${xentry%%,*}"
xentry="${xentry#*,}"
local xgw="${xentry%%,*}"
# work around if there is a PIO matching a RIO [ -n "$gw" -a -z "$xgw" -a "$addr/$mask" = "$xprefix" ] && duplicate=1
# Linux seems to prefer source-dest over dest-only even if metric is higher done
proto_add_ipv6_route "$addr" "$mask" "$gw" "$metric" "$valid" "$addr/$mask"
if [ -z "$gw" -o "$duplicate" = 1 ]; then
proto_add_ipv6_route "$addr" "$mask" "$gw" "$metric" "$valid"
else else
for prefix in $PREFIXES $ADDRESSES; do for prefix in $PREFIXES $ADDRESSES; do
local paddr="${prefix%%,*}" local paddr="${prefix%%,*}"