From 3029fa71f4bce0d5607e03ff3d679491b99999ce Mon Sep 17 00:00:00 2001 From: Jun-ichiro itojun Hagino Date: Thu, 29 May 2003 04:55:56 +0000 Subject: use IN6_LINKMTU for IPv6 link MTU. sync w/kame --- sys/netinet/tcp_input.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'sys/netinet/tcp_input.c') 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); } -- cgit v1.2.3