Changeset View
Changeset View
Standalone View
Standalone View
head/sys/netinet6/raw_ip6.c
Show First 20 Lines • Show All 489 Lines • ▼ Show 20 Lines | if (so->so_proto->pr_protocol == IPPROTO_ICMPV6 || | ||||
int off; | int off; | ||||
u_int16_t *p; | u_int16_t *p; | ||||
/* Compute checksum. */ | /* Compute checksum. */ | ||||
if (so->so_proto->pr_protocol == IPPROTO_ICMPV6) | if (so->so_proto->pr_protocol == IPPROTO_ICMPV6) | ||||
off = offsetof(struct icmp6_hdr, icmp6_cksum); | off = offsetof(struct icmp6_hdr, icmp6_cksum); | ||||
else | else | ||||
off = in6p->in6p_cksum; | off = in6p->in6p_cksum; | ||||
if (plen < off + 1) { | if (plen < off + 2) { | ||||
error = EINVAL; | error = EINVAL; | ||||
goto bad; | goto bad; | ||||
} | } | ||||
off += sizeof(struct ip6_hdr); | off += sizeof(struct ip6_hdr); | ||||
n = m; | n = m; | ||||
while (n && n->m_len <= off) { | while (n && n->m_len <= off) { | ||||
off -= n->m_len; | off -= n->m_len; | ||||
▲ Show 20 Lines • Show All 399 Lines • Show Last 20 Lines |