Avoid infinite loop if nicmp6 and nip6 are not on the same mbuf.

NetBSD PR 34994+35333

MFC after:	3 days
This commit is contained in:
Hajimu UMEMOTO 2007-01-16 15:55:29 +00:00
parent e9f0620b9f
commit 6a550ab34b

View File

@ -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;