summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorNiels Provos <provos@cvs.openbsd.org>2000-09-21 17:30:49 +0000
committerNiels Provos <provos@cvs.openbsd.org>2000-09-21 17:30:49 +0000
commit21b924c04c186890fc5a060134661e1aa7216184 (patch)
treea13ad272511c32f96b9aeec159a917c0deb707da /sys
parenta07a94a90006d7c8d96d8d7951643d28eb4489f9 (diff)
calculate maxopd at the right place
Diffstat (limited to 'sys')
-rw-r--r--sys/netinet/tcp_input.c26
1 files 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 $ */
/*
@@ -2864,6 +2864,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
* segment. We need to store this value (maxopd) apart
@@ -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) {