summaryrefslogtreecommitdiffstats
path: root/sys/netinet/tcp_input.c
diff options
context:
space:
mode:
authoritojun <itojun@openbsd.org>2003-05-29 04:55:55 +0000
committeritojun <itojun@openbsd.org>2003-05-29 04:55:55 +0000
commit8fc9cea84b3e00f90e1da2f0148460576b94da49 (patch)
tree34f72193badf56fbff739f7377419feff7cbd535 /sys/netinet/tcp_input.c
parent>permit numberic values for uid and gid; allow "<" and ">" for less and (diff)
downloadwireguard-openbsd-8fc9cea84b3e00f90e1da2f0148460576b94da49.tar.xz
wireguard-openbsd-8fc9cea84b3e00f90e1da2f0148460576b94da49.zip
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);
}