From 21b924c04c186890fc5a060134661e1aa7216184 Mon Sep 17 00:00:00 2001 From: Niels Provos Date: Thu, 21 Sep 2000 17:30:49 +0000 Subject: calculate maxopd at the right place --- sys/netinet/tcp_input.c | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/sys/netinet/tcp_input.c b/sys/netinet/tcp_input.c index 493d778d08a..f557b42e942 100644 --- a/sys/netinet/tcp_input.c +++ b/sys/netinet/tcp_input.c @@ -1,4 +1,4 @@ -/* $OpenBSD: tcp_input.c,v 1.74 2000/09/20 17:00:22 provos Exp $ */ +/* $OpenBSD: tcp_input.c,v 1.75 2000/09/21 17:30:48 provos Exp $ */ /* $NetBSD: tcp_input.c,v 1.23 1996/02/13 23:43:44 christos Exp $ */ /* @@ -2863,6 +2863,18 @@ tcp_mss(tp, offer) } out: + /* + * The current mss, t_maxseg, is initialized to the default value. + * If we compute a smaller value, reduce the current mss. + * If we compute a larger value, return it for use in sending + * a max seg size option, but don't store it for use + * unless we received an offer at least that large from peer. + * However, do not accept offers under 32 bytes. + */ + if (offer && offer != -1) + mss = min(mss, offer); + mss = max(mss, 64); /* sanity - at least max opt. space */ + /* * maxopd stores the maximum length of data AND options * in a segment; maxseg is the amount of data in a normal @@ -2876,18 +2888,6 @@ tcp_mss(tp, offer) (tp->t_flags & TF_RCVD_TSTMP) == TF_RCVD_TSTMP) mss -= TCPOLEN_TSTAMP_APPA; - /* - * The current mss, t_maxseg, is initialized to the default value. - * If we compute a smaller value, reduce the current mss. - * If we compute a larger value, return it for use in sending - * a max seg size option, but don't store it for use - * unless we received an offer at least that large from peer. - * However, do not accept offers under 32 bytes. - */ - if (offer && offer != -1) - mss = min(mss, offer); - mss = max(mss, 64); /* sanity - at least max opt. space */ - if (offer == -1) { /* mss changed due to Path MTU discovery */ if (mss < tp->t_maxseg) { -- cgit v1.2.3