mirror of
https://git.savannah.nongnu.org/git/lwip.git
synced 2026-05-27 18:47:13 +08:00
Fix bug #47641: lwIP would accept IPv6 source addresses from the network that are mapped IPv4 adresses
This commit is contained in:
@@ -444,6 +444,14 @@ ip6_input(struct pbuf *p, struct netif *inp)
|
||||
ip_addr_copy_from_ip6(ip_data.current_iphdr_dest, ip6hdr->dest);
|
||||
ip_addr_copy_from_ip6(ip_data.current_iphdr_src, ip6hdr->src);
|
||||
|
||||
/* Don't accept virtual IPv6 mapped IPv4 addresses */
|
||||
if(ip6_addr_isipv6mappedipv4(ip_2_ip6(&ip_data.current_iphdr_dest)) ||
|
||||
ip6_addr_isipv6mappedipv4(ip_2_ip6(&ip_data.current_iphdr_src)) ) {
|
||||
IP6_STATS_INC(ip6.err);
|
||||
IP6_STATS_INC(ip6.drop);
|
||||
return ERR_OK;
|
||||
}
|
||||
|
||||
/* current header pointer. */
|
||||
ip_data.current_ip6_header = ip6hdr;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user