Author: tuexen
Date: Fri Apr 19 18:09:37 2019
New Revision: 346406
URL: https://svnweb.freebsd.org/changeset/base/346406

Log:
  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

Modified:
  head/sys/netinet6/raw_ip6.c

Modified: head/sys/netinet6/raw_ip6.c
==============================================================================
--- head/sys/netinet6/raw_ip6.c Fri Apr 19 18:00:33 2019        (r346405)
+++ head/sys/netinet6/raw_ip6.c Fri Apr 19 18:09:37 2019        (r346406)
@@ -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;
                        }
                }
_______________________________________________
[email protected] mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "[email protected]"

Reply via email to