diff options
author | Michael Tuexen <tuexen@FreeBSD.org> | 2019-04-19 18:09:37 +0000 |
---|---|---|
committer | Michael Tuexen <tuexen@FreeBSD.org> | 2019-04-19 18:09:37 +0000 |
commit | fb288770e84e01f8ac6e0f99de2dc2e71e48c254 (patch) | |
tree | d04ad850c8d87d1d93d1e1acc4157c91e87ba3f9 /sys/netinet6/raw_ip6.c | |
parent | 3a9d0aca8a85cbcf6fa9091bf7fc00b2b106e19c (diff) |
When an IPv6 packet is received for a raw socket which has the
IPPROTO_IPV6 level socket option IPV6_CHECKSUM enabled and the
checksum check fails, drop the message. Without this fix, an
ICMP6 message was sent indicating a parameter problem.
Thanks to bz@ for suggesting a way to simplify this fix.
Reviewed by: bz@
MFC after: 1 week
Sponsored by: Netflix, Inc.
Differential Revision: https://reviews.freebsd.org/D19969
Notes
Notes:
svn path=/head/; revision=346406
Diffstat (limited to 'sys/netinet6/raw_ip6.c')
-rw-r--r-- | sys/netinet6/raw_ip6.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/sys/netinet6/raw_ip6.c b/sys/netinet6/raw_ip6.c index 69712fd45bcd..fbe6c942424d 100644 --- a/sys/netinet6/raw_ip6.c +++ b/sys/netinet6/raw_ip6.c @@ -243,6 +243,12 @@ rip6_input(struct mbuf **mp, int *offp, int proto) in6_cksum(m, proto, *offp, m->m_pkthdr.len - *offp)) { RIP6STAT_INC(rip6s_badsum); + /* + * Drop the received message, don't send an + * ICMP6 message. Set proto to IPPROTO_NONE + * to achieve that. + */ + proto = IPPROTO_NONE; goto skip_2; } } |