Skip to content

Commit ec5e3b0

Browse files
Jonathan T. Leightondavem330
authored andcommitted
ipv6: Inhibit IPv4-mapped src address on the wire.
This patch adds a check for the problematic case of an IPv4-mapped IPv6 source address and a destination address that is neither an IPv4-mapped IPv6 address nor in6addr_any, and returns an appropriate error. The check in done before returning from looking up the route. Signed-off-by: Jonathan T. Leighton <jtleight@udel.edu> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent fed06ee commit ec5e3b0

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

net/ipv6/ip6_output.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1021,6 +1021,9 @@ static int ip6_dst_lookup_tail(struct net *net, const struct sock *sk,
10211021
}
10221022
}
10231023
#endif
1024+
if (ipv6_addr_v4mapped(&fl6->saddr) &&
1025+
!(ipv6_addr_v4mapped(&fl6->daddr) || ipv6_addr_any(&fl6->daddr)))
1026+
return -EAFNOSUPPORT;
10241027

10251028
return 0;
10261029

0 commit comments

Comments
 (0)