From: Erik Nordmark Date: Sun, 4 Dec 2016 04:57:09 +0000 (-0800) Subject: ipv6: Allow IPv4-mapped address as next-hop X-Git-Tag: v4.14-rc1~1973^2~82 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=96d5822c1d812ed30da035795a4408f43fe533f3;p=platform%2Fkernel%2Flinux-rpi.git ipv6: Allow IPv4-mapped address as next-hop Made kernel accept IPv6 routes with IPv4-mapped address as next-hop. It is possible to configure IP interfaces with IPv4-mapped addresses, and one can add IPv6 routes for IPv4-mapped destinations/prefixes, yet prior to this fix the kernel returned an EINVAL when attempting to add an IPv6 route with an IPv4-mapped address as a nexthop/gateway. RFC 4798 (a proposed standard RFC) uses IPv4-mapped addresses as nexthops, thus in order to support that type of address configuration the kernel needs to allow IPv4-mapped addresses as nexthops. Signed-off-by: Erik Nordmark Signed-off-by: Bob Gilligan Signed-off-by: David S. Miller --- diff --git a/net/ipv6/route.c b/net/ipv6/route.c index aac7818..2413a06 100644 --- a/net/ipv6/route.c +++ b/net/ipv6/route.c @@ -2000,8 +2000,11 @@ static struct rt6_info *ip6_route_info_create(struct fib6_config *cfg) It is very good, but in some (rare!) circumstances (SIT, PtP, NBMA NOARP links) it is handy to allow some exceptions. --ANK + We allow IPv4-mapped nexthops to support RFC4798-type + addressing */ - if (!(gwa_type & IPV6_ADDR_UNICAST)) + if (!(gwa_type & (IPV6_ADDR_UNICAST | + IPV6_ADDR_MAPPED))) goto out; if (cfg->fc_table) {