aboutsummaryrefslogtreecommitdiff
path: root/sys/netinet
diff options
context:
space:
mode:
authorSepherosa Ziehau <sephe@FreeBSD.org>2017-09-27 05:52:37 +0000
committerSepherosa Ziehau <sephe@FreeBSD.org>2017-09-27 05:52:37 +0000
commitfc572e261f8062081107636de595fb5146d8d8f2 (patch)
treed57b46c4c60d2cedef00457f25c0a592404b7dbb /sys/netinet
parent2be266caf27d62f59031d04ac677d3692badef11 (diff)
Notes
Diffstat (limited to 'sys/netinet')
-rw-r--r--sys/netinet/tcp_syncache.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/sys/netinet/tcp_syncache.c b/sys/netinet/tcp_syncache.c
index 64a2e36b3da8..cf075022fdad 100644
--- a/sys/netinet/tcp_syncache.c
+++ b/sys/netinet/tcp_syncache.c
@@ -1634,9 +1634,7 @@ syncache_respond(struct syncache *sc, struct syncache_head *sch, int locked,
tlen = hlen + sizeof(struct tcphdr);
/* Determine MSS we advertize to other end of connection. */
- mssopt = tcp_mssopt(&sc->sc_inc);
- if (sc->sc_peer_mss)
- mssopt = max( min(sc->sc_peer_mss, mssopt), V_tcp_minmss);
+ mssopt = max(tcp_mssopt(&sc->sc_inc), V_tcp_minmss);
/* XXX: Assume that the entire packet will fit in a header mbuf. */
KASSERT(max_linkhdr + tlen + TCP_MAXOLEN <= MHLEN,
@@ -1985,7 +1983,7 @@ syncookie_mac(struct in_conninfo *inc, tcp_seq irs, uint8_t flags,
static tcp_seq
syncookie_generate(struct syncache_head *sch, struct syncache *sc)
{
- u_int i, mss, secbit, wscale;
+ u_int i, secbit, wscale;
uint32_t iss, hash;
uint8_t *secbits;
union syncookie cookie;
@@ -1995,8 +1993,8 @@ syncookie_generate(struct syncache_head *sch, struct syncache *sc)
cookie.cookie = 0;
/* Map our computed MSS into the 3-bit index. */
- mss = min(tcp_mssopt(&sc->sc_inc), max(sc->sc_peer_mss, V_tcp_minmss));
- for (i = nitems(tcp_sc_msstab) - 1; tcp_sc_msstab[i] > mss && i > 0;
+ for (i = nitems(tcp_sc_msstab) - 1;
+ tcp_sc_msstab[i] > sc->sc_peer_mss && i > 0;
i--)
;
cookie.flags.mss_idx = i;