Author: tuexen
Date: Thu Nov 26 09:25:20 2015
New Revision: 291364
URL: https://svnweb.freebsd.org/changeset/base/291364

Log:
  When receiving an SCTP/UDP packet and the interface performed
  the UDP checksum computation and signals that it was OK,
  clear this bit when passing the packet to SCTP. Since the
  bits indicating a valid UDP checksum and a valid SCTP
  checksum are the same, the SCTP stack would assume
  that also an SCTP checksum check has been performed.
  
  MFC after: 1 week

Modified:
  head/sys/netinet/sctputil.c

Modified: head/sys/netinet/sctputil.c
==============================================================================
--- head/sys/netinet/sctputil.c Thu Nov 26 08:58:13 2015        (r291363)
+++ head/sys/netinet/sctputil.c Thu Nov 26 09:25:20 2015        (r291364)
@@ -6957,6 +6957,18 @@ sctp_recv_udp_tunneled_packet(struct mbu
        for (last = m; last->m_next; last = last->m_next);
        last->m_next = sp;
        m->m_pkthdr.len += sp->m_pkthdr.len;
+       /*
+        * The CSUM_DATA_VALID flags indicates that the HW checked the UDP
+        * checksum and it was valid. Since CSUM_DATA_VALID ==
+        * CSUM_SCTP_VALID this would imply that the HW also verified the
+        * SCTP checksum. Therefore, clear the bit.
+        */
+       SCTPDBG(SCTP_DEBUG_CRCOFFLOAD,
+           "sctp_recv_udp_tunneled_packet(): Packet of length %d received on 
%s with csum_flags 0x%b.\n",
+           m->m_pkthdr.len,
+           if_name(m->m_pkthdr.rcvif),
+           (int)m->m_pkthdr.csum_flags, CSUM_BITS);
+       m->m_pkthdr.csum_flags &= ~CSUM_DATA_VALID;
        iph = mtod(m, struct ip *);
        switch (iph->ip_v) {
 #ifdef INET
_______________________________________________
[email protected] mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "[email protected]"

Reply via email to