summaryrefslogtreecommitdiffstats
path: root/sys/netinet
diff options
context:
space:
mode:
authortuexen <tuexen@FreeBSD.org>2016-01-16 18:59:10 +0000
committertuexen <tuexen@FreeBSD.org>2016-01-16 18:59:10 +0000
commit28f497d302178844843a97044b9d18027c124fc7 (patch)
tree70588709cb869b7d34a6195292b95f08126dc50e /sys/netinet
parentb28cb12edb62ff49ceda216250855ecf3c0e2fe4 (diff)
downloadFreeBSD-src-28f497d302178844843a97044b9d18027c124fc7.zip
FreeBSD-src-28f497d302178844843a97044b9d18027c124fc7.tar.gz
MFC r291364:
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.
Diffstat (limited to 'sys/netinet')
-rw-r--r--sys/netinet/sctputil.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/sys/netinet/sctputil.c b/sys/netinet/sctputil.c
index cae0e26..8d8f375 100644
--- a/sys/netinet/sctputil.c
+++ b/sys/netinet/sctputil.c
@@ -6957,6 +6957,18 @@ sctp_recv_udp_tunneled_packet(struct mbuf *m, int off, struct inpcb *inp,
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
OpenPOWER on IntegriCloud