Skip to content

Commit 96d5822

Browse files
Erik Nordmarkdavem330
authored andcommitted
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 <[email protected]> Signed-off-by: Bob Gilligan <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 3c83974 commit 96d5822

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

net/ipv6/route.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2000,8 +2000,11 @@ static struct rt6_info *ip6_route_info_create(struct fib6_config *cfg)
20002000
It is very good, but in some (rare!) circumstances
20012001
(SIT, PtP, NBMA NOARP links) it is handy to allow
20022002
some exceptions. --ANK
2003+
We allow IPv4-mapped nexthops to support RFC4798-type
2004+
addressing
20032005
*/
2004-
if (!(gwa_type & IPV6_ADDR_UNICAST))
2006+
if (!(gwa_type & (IPV6_ADDR_UNICAST |
2007+
IPV6_ADDR_MAPPED)))
20052008
goto out;
20062009

20072010
if (cfg->fc_table) {

0 commit comments

Comments
 (0)