summaryrefslogtreecommitdiffstats
path: root/sys/netinet6
diff options
context:
space:
mode:
authortuexen <tuexen@FreeBSD.org>2010-08-29 18:50:30 +0000
committertuexen <tuexen@FreeBSD.org>2010-08-29 18:50:30 +0000
commitff0f13be619dafe05ca0a216f79368d4c793a420 (patch)
treec683856a6c329e114bb11002250dfde16a196871 /sys/netinet6
parentc7313507efc899f693f73ecc1b97b23563178ad5 (diff)
downloadFreeBSD-src-ff0f13be619dafe05ca0a216f79368d4c793a420.zip
FreeBSD-src-ff0f13be619dafe05ca0a216f79368d4c793a420.tar.gz
Fix the the SCTP_WITH_NO_CSUM option when used in combination with
interface supporting CRC offload. While at it, make use of the feature that the loopback interface provides CRC offloading. MFC after: 4 weeks
Diffstat (limited to 'sys/netinet6')
-rw-r--r--sys/netinet6/sctp6_usrreq.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/sys/netinet6/sctp6_usrreq.c b/sys/netinet6/sctp6_usrreq.c
index 1fce08e..8c14056 100644
--- a/sys/netinet6/sctp6_usrreq.c
+++ b/sys/netinet6/sctp6_usrreq.c
@@ -72,7 +72,6 @@ sctp6_input(struct mbuf **i_pak, int *offp, int proto)
struct sctp_inpcb *in6p = NULL;
struct sctp_nets *net;
int refcount_up = 0;
- uint32_t check, calc_check;
uint32_t vrf_id = 0;
struct inpcb *in6p_ip;
struct sctp_chunkhdr *ch;
@@ -80,6 +79,11 @@ sctp6_input(struct mbuf **i_pak, int *offp, int proto)
uint8_t ecn_bits;
struct sctp_tcb *stcb = NULL;
int pkt_len = 0;
+
+#if !defined(SCTP_WITH_NO_CSUM)
+ uint32_t check, calc_check;
+
+#endif
int off = *offp;
uint16_t port = 0;
@@ -133,6 +137,9 @@ sctp6_input(struct mbuf **i_pak, int *offp, int proto)
m->m_pkthdr.len,
if_name(m->m_pkthdr.rcvif),
m->m_pkthdr.csum_flags);
+#if defined(SCTP_WITH_NO_CSUM)
+ SCTP_STAT_INCR(sctps_recvnocrc);
+#else
if (m->m_pkthdr.csum_flags & CSUM_SCTP_VALID) {
SCTP_STAT_INCR(sctps_recvhwcrc);
goto sctp_skip_csum;
@@ -171,6 +178,7 @@ sctp6_input(struct mbuf **i_pak, int *offp, int proto)
sh->checksum = calc_check;
sctp_skip_csum:
+#endif
net = NULL;
/*
* Locate pcb and tcb for datagram sctp_findassociation_addr() wants
OpenPOWER on IntegriCloud