diff options
author | Hans Dedecker <dedeckeh@gmail.com> | 2017-09-05 14:33:01 +0200 |
---|---|---|
committer | Hans Dedecker <dedeckeh@gmail.com> | 2017-09-05 14:46:18 +0200 |
commit | 995193ccdb2adb2bfe226965589b5f3db71bdd80 (patch) | |
tree | 2656c8c4b0f92a0b14e214d62e5edfccfbe47354 /package/network/ipv6/odhcp6c/files/dhcpv6.script | |
parent | 6b06c2fb8ec15faed936cae79f3d6cec2705cac1 (diff) | |
download | mtk-20170518-995193ccdb2adb2bfe226965589b5f3db71bdd80.zip mtk-20170518-995193ccdb2adb2bfe226965589b5f3db71bdd80.tar.gz mtk-20170518-995193ccdb2adb2bfe226965589b5f3db71bdd80.tar.bz2 |
odhcp6c: add workaround for broken extendprefix scenario
Extendprefix is typically used to extend an IPv6 RA prefix from a mobile
wan link to the LAN; such scenario requires correct RA prefix settings
like the on link flag not being set.
However some mobile manufacter set the RA prefix on link flag which breaks
basic IPv6 routing.
Work around this issue by filtering out the route being equal to the
extended prefix.
Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
Diffstat (limited to 'package/network/ipv6/odhcp6c/files/dhcpv6.script')
-rwxr-xr-x | package/network/ipv6/odhcp6c/files/dhcpv6.script | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/package/network/ipv6/odhcp6c/files/dhcpv6.script b/package/network/ipv6/odhcp6c/files/dhcpv6.script index ab0b556..03efaf7 100755 --- a/package/network/ipv6/odhcp6c/files/dhcpv6.script +++ b/package/network/ipv6/odhcp6c/files/dhcpv6.script @@ -81,6 +81,23 @@ setup_interface () { # RFC 7278 if [ "$mask" -eq 64 -a -z "$PREFIXES" -a -n "$EXTENDPREFIX" ]; then proto_add_ipv6_prefix "$addr/$mask,$preferred,$valid" + + local raroutes="" + for route in $RA_ROUTES; do + local prefix="${route%%/*}" + local entry="${route#*/}" + local pmask="${entry%%,*}" + entry="${entry#*,}" + local gw="${entry%%,*}" + + [ -z "$gw" -a "$mask" = "$pmask" ] && { + case "$addr" in + "${prefix%*::}"*) continue;; + esac + } + raroutes="$raroutes $route" + done + RA_ROUTES="$raroutes" fi done |