aboutsummaryrefslogtreecommitdiff
path: root/sys/netinet6
diff options
context:
space:
mode:
authorMark Johnston <markj@FreeBSD.org>2023-03-13 14:45:56 +0000
committerMark Johnston <markj@FreeBSD.org>2023-03-13 14:45:56 +0000
commitaa71d6b4a2ec3609303ca87ba75d0a2c539da9df (patch)
tree83d99e1efe8f3b69925747bd9a40f44f9292a829 /sys/netinet6
parent29c9b1673305406dc64161aa7b565a296526fa67 (diff)
downloadsrc-aa71d6b4a2ec3609303ca87ba75d0a2c539da9df.tar.gz
src-aa71d6b4a2ec3609303ca87ba75d0a2c539da9df.zip
Diffstat (limited to 'sys/netinet6')
-rw-r--r--sys/netinet6/icmp6.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/sys/netinet6/icmp6.c b/sys/netinet6/icmp6.c
index 5c94a0c56be1..4166cabdc5cb 100644
--- a/sys/netinet6/icmp6.c
+++ b/sys/netinet6/icmp6.c
@@ -1070,6 +1070,14 @@ icmp6_notify_error(struct mbuf **mp, int off, int icmp6len)
*/
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))