Page MenuHomeFreeBSD

D38936.diff
No OneTemporary

D38936.diff

diff --git a/sys/netinet/ip_icmp.c b/sys/netinet/ip_icmp.c
--- a/sys/netinet/ip_icmp.c
+++ b/sys/netinet/ip_icmp.c
@@ -561,7 +561,8 @@
if (IN_MULTICAST(ntohl(icp->icmp_ip.ip_dst.s_addr)))
goto badcode;
/* Filter out responses to INADDR_ANY, protocols ignore it. */
- if (icp->icmp_ip.ip_dst.s_addr == INADDR_ANY)
+ if (icp->icmp_ip.ip_dst.s_addr == INADDR_ANY ||
+ icp->icmp_ip.ip_src.s_addr == INADDR_ANY)
goto freeit;
#ifdef ICMPPRINTFS
if (icmpprintfs)
diff --git a/sys/netinet6/icmp6.c b/sys/netinet6/icmp6.c
--- a/sys/netinet6/icmp6.c
+++ b/sys/netinet6/icmp6.c
@@ -1070,6 +1070,14 @@
*/
eip6 = (struct ip6_hdr *)(icmp6 + 1);
+ /*
+ * Protocol layers can't do anything useful with unspecified
+ * addresses.
+ */
+ if (IN6_IS_ADDR_UNSPECIFIED(&eip6->ip6_src) ||
+ IN6_IS_ADDR_UNSPECIFIED(&eip6->ip6_dst))
+ goto freeit;
+
icmp6dst.sin6_len = sizeof(struct sockaddr_in6);
icmp6dst.sin6_family = AF_INET6;
if (IN6_IS_ADDR_UNSPECIFIED(&icmp6dst.sin6_addr))

File Metadata

Mime Type
text/plain
Expires
Sun, Nov 17, 2:24 AM (21 h, 35 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
14669170
Default Alt Text
D38936.diff (1018 B)

Event Timeline