summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorume <ume@FreeBSD.org>2007-01-16 15:55:29 +0000
committerume <ume@FreeBSD.org>2007-01-16 15:55:29 +0000
commit66ac91ed3b72b4195a44516c9cefc590a4d199a9 (patch)
tree17840d3427ece06c7424f6a4972edb6642c31165
parent39f3fe7daf5b4cec90afbe413b53ae5f77acad42 (diff)
downloadFreeBSD-src-66ac91ed3b72b4195a44516c9cefc590a4d199a9.zip
FreeBSD-src-66ac91ed3b72b4195a44516c9cefc590a4d199a9.tar.gz
Avoid infinite loop if nicmp6 and nip6 are not on the same mbuf.
NetBSD PR 34994+35333 MFC after: 3 days
-rw-r--r--sys/netinet6/icmp6.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/sys/netinet6/icmp6.c b/sys/netinet6/icmp6.c
index 9ab0741..d2cb1b7 100644
--- a/sys/netinet6/icmp6.c
+++ b/sys/netinet6/icmp6.c
@@ -588,7 +588,8 @@ icmp6_input(mp, offp, proto)
n->m_next = n0;
} else {
nip6 = mtod(n, struct ip6_hdr *);
- nicmp6 = (struct icmp6_hdr *)((caddr_t)nip6 + off);
+ IP6_EXTHDR_GET(nicmp6, struct icmp6_hdr *, n, off,
+ sizeof(*nicmp6));
noff = off;
}
nicmp6->icmp6_type = ICMP6_ECHO_REPLY;
OpenPOWER on IntegriCloud