diff options
author | np <np@FreeBSD.org> | 2015-04-07 17:40:35 +0000 |
---|---|---|
committer | np <np@FreeBSD.org> | 2015-04-07 17:40:35 +0000 |
commit | 5ac556fbb884358c57287b3ce67b5244c2192fdd (patch) | |
tree | 1fb37d9431e566bf97b852169eb7064d9b345a22 /sys/dev | |
parent | b84f5bafd442ef84e47fa856a2b57253a54b5b4d (diff) | |
download | FreeBSD-src-5ac556fbb884358c57287b3ce67b5244c2192fdd.zip FreeBSD-src-5ac556fbb884358c57287b3ce67b5244c2192fdd.tar.gz |
MFC r276574:
cxgbe/tom: fix the MSS calculation for IPv6 connections handled by the TOE.
Diffstat (limited to 'sys/dev')
-rw-r--r-- | sys/dev/cxgbe/tom/t4_cpl_io.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/sys/dev/cxgbe/tom/t4_cpl_io.c b/sys/dev/cxgbe/tom/t4_cpl_io.c index bea5cff..a3bd152 100644 --- a/sys/dev/cxgbe/tom/t4_cpl_io.c +++ b/sys/dev/cxgbe/tom/t4_cpl_io.c @@ -44,6 +44,7 @@ __FBSDID("$FreeBSD$"); #include <netinet/in.h> #include <netinet/in_pcb.h> #include <netinet/ip.h> +#include <netinet/ip6.h> #include <netinet/tcp_var.h> #define TCPSTATES #include <netinet/tcp_fsm.h> @@ -236,11 +237,20 @@ static void assign_rxopt(struct tcpcb *tp, unsigned int opt) { struct toepcb *toep = tp->t_toe; + struct inpcb *inp = tp->t_inpcb; struct adapter *sc = td_adapter(toep->td); + int n; + + INP_LOCK_ASSERT(inp); - INP_LOCK_ASSERT(tp->t_inpcb); + if (inp->inp_inc.inc_flags & INC_ISIPV6) + n = sizeof(struct ip6_hdr) + sizeof(struct tcphdr); + else + n = sizeof(struct ip) + sizeof(struct tcphdr); + tp->t_maxseg = tp->t_maxopd = sc->params.mtus[G_TCPOPT_MSS(opt)] - n; - tp->t_maxseg = tp->t_maxopd = sc->params.mtus[G_TCPOPT_MSS(opt)] - 40; + CTR4(KTR_CXGBE, "%s: tid %d, mtu_idx %u (%u)", __func__, toep->tid, + G_TCPOPT_MSS(opt), sc->params.mtus[G_TCPOPT_MSS(opt)]); if (G_TCPOPT_TSTAMP(opt)) { tp->t_flags |= TF_RCVD_TSTMP; /* timestamps ok */ |