aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sys/netinet/tcp_input.c19
-rw-r--r--sys/netinet/tcp_subr.c2
-rw-r--r--sys/netinet/tcp_var.h2
3 files changed, 12 insertions, 11 deletions
diff --git a/sys/netinet/tcp_input.c b/sys/netinet/tcp_input.c
index 961bdd6a867b..41908b140c76 100644
--- a/sys/netinet/tcp_input.c
+++ b/sys/netinet/tcp_input.c
@@ -2727,14 +2727,14 @@ tcp_xmit_timer(struct tcpcb *tp, int rtt)
* segment. Outgoing SYN/ACK MSS settings are handled in tcp_mssopt().
*/
void
-tcp_mss_update(struct tcpcb *tp, int offer, struct hc_metrics_lite *metricptr)
+tcp_mss_update(struct tcpcb *tp, int offer,
+ struct hc_metrics_lite *metricptr, int *mtuflags)
{
int mss;
u_long maxmtu;
struct inpcb *inp = tp->t_inpcb;
struct hc_metrics_lite metrics;
int origoffer = offer;
- int mtuflags = 0;
#ifdef INET6
int isipv6 = ((inp->inp_vflag & INP_IPV6) != 0) ? 1 : 0;
size_t min_protoh = isipv6 ?
@@ -2749,12 +2749,12 @@ tcp_mss_update(struct tcpcb *tp, int offer, struct hc_metrics_lite *metricptr)
/* Initialize. */
#ifdef INET6
if (isipv6) {
- maxmtu = tcp_maxmtu6(&inp->inp_inc, &mtuflags);
+ maxmtu = tcp_maxmtu6(&inp->inp_inc, mtuflags);
tp->t_maxopd = tp->t_maxseg = tcp_v6mssdflt;
} else
#endif
{
- maxmtu = tcp_maxmtu(&inp->inp_inc, &mtuflags);
+ maxmtu = tcp_maxmtu(&inp->inp_inc, mtuflags);
tp->t_maxopd = tp->t_maxseg = tcp_mssdflt;
}
@@ -2772,10 +2772,6 @@ tcp_mss_update(struct tcpcb *tp, int offer, struct hc_metrics_lite *metricptr)
return;
}
- /* Check the interface for TSO capabilities. */
- if (mtuflags & CSUM_TSO)
- tp->t_flags |= TF_TSO;
-
/* What have we got? */
switch (offer) {
case 0:
@@ -2894,12 +2890,13 @@ tcp_mss(struct tcpcb *tp, int offer)
struct inpcb *inp;
struct socket *so;
struct hc_metrics_lite metrics;
+ int mtuflags = 0;
#ifdef INET6
int isipv6;
#endif
KASSERT(tp != NULL, ("%s: tp == NULL", __func__));
- tcp_mss_update(tp, offer, &metrics);
+ tcp_mss_update(tp, offer, &metrics, &mtuflags);
mss = tp->t_maxseg;
inp = tp->t_inpcb;
@@ -3012,6 +3009,10 @@ tcp_mss(struct tcpcb *tp, int offer)
tp->snd_cwnd = mss * ss_fltsz_local;
else
tp->snd_cwnd = mss * ss_fltsz;
+
+ /* Check the interface for TSO capabilities. */
+ if (mtuflags & CSUM_TSO)
+ tp->t_flags |= TF_TSO;
}
/*
diff --git a/sys/netinet/tcp_subr.c b/sys/netinet/tcp_subr.c
index 918b9b5868f2..1dd9d496cb63 100644
--- a/sys/netinet/tcp_subr.c
+++ b/sys/netinet/tcp_subr.c
@@ -1519,7 +1519,7 @@ tcp_mtudisc(struct inpcb *inp, int errno)
tp = intotcpcb(inp);
KASSERT(tp != NULL, ("tcp_mtudisc: tp == NULL"));
- tcp_mss_update(tp, -1, NULL);
+ tcp_mss_update(tp, -1, NULL, NULL);
so = inp->inp_socket;
SOCKBUF_LOCK(&so->so_snd);
diff --git a/sys/netinet/tcp_var.h b/sys/netinet/tcp_var.h
index 73e385296967..3117430888a0 100644
--- a/sys/netinet/tcp_var.h
+++ b/sys/netinet/tcp_var.h
@@ -544,7 +544,7 @@ void tcp_reass_init(void);
void tcp_input(struct mbuf *, int);
u_long tcp_maxmtu(struct in_conninfo *, int *);
u_long tcp_maxmtu6(struct in_conninfo *, int *);
-void tcp_mss_update(struct tcpcb *, int, struct hc_metrics_lite *);
+void tcp_mss_update(struct tcpcb *, int, struct hc_metrics_lite *, int *);
void tcp_mss(struct tcpcb *, int);
int tcp_mssopt(struct in_conninfo *);
struct inpcb *