summaryrefslogtreecommitdiff
path: root/sys/netinet/tcp_input.c
diff options
context:
space:
mode:
authorJun-ichiro itojun Hagino <itojun@cvs.openbsd.org>2003-05-29 04:55:56 +0000
committerJun-ichiro itojun Hagino <itojun@cvs.openbsd.org>2003-05-29 04:55:56 +0000
commit3029fa71f4bce0d5607e03ff3d679491b99999ce (patch)
treef13d019fc93cc5e7f81693e198382b88253f662e /sys/netinet/tcp_input.c
parent8b8ab4327b774ea66af3941fd57b1e16c6e0a868 (diff)
use IN6_LINKMTU for IPv6 link MTU. sync w/kame
Diffstat (limited to 'sys/netinet/tcp_input.c')
-rw-r--r--sys/netinet/tcp_input.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/sys/netinet/tcp_input.c b/sys/netinet/tcp_input.c
index 940f09d267d..a56d1dd0647 100644
--- a/sys/netinet/tcp_input.c
+++ b/sys/netinet/tcp_input.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: tcp_input.c,v 1.128 2003/05/29 00:35:18 itojun Exp $ */
+/* $OpenBSD: tcp_input.c,v 1.129 2003/05/29 04:55:55 itojun Exp $ */
/* $NetBSD: tcp_input.c,v 1.23 1996/02/13 23:43:44 christos Exp $ */
/*
@@ -3011,7 +3011,16 @@ tcp_mss(tp, offer)
/* Calculate the value that we offer in TCPOPT_MAXSEG */
if (offer != -1) {
+#ifndef INET6
mssopt = ifp->if_mtu - iphlen - sizeof(struct tcphdr);
+#else
+ if (tp->pf == AF_INET)
+ mssopt = ifp->if_mtu - iphlen - sizeof(struct tcphdr);
+ else
+ mssopt = IN6_LINKMTU(ifp) - iphlen -
+ sizeof(struct tcphdr);
+#endif
+
mssopt = max(tcp_mssdflt, mssopt);
}