From ffabe3dce88027ddf00a5a59236dea6cbc54f7df Mon Sep 17 00:00:00 2001 From: Andre Oppermann Date: Sat, 10 Sep 2005 07:43:29 +0000 Subject: [PATCH] In tcp_ctlinput() do not swap ip->ip_len a second time. It has been done in icmp_input() already. This fixes the ICMP_UNREACH_NEEDFRAG case where no MTU was proposed in the ICMP reply. PR: kern/81813 Submitted by: Vitezslav Novy MFC after: 3 days --- sys/netinet/tcp_subr.c | 5 +++-- sys/netinet/tcp_timewait.c | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/sys/netinet/tcp_subr.c b/sys/netinet/tcp_subr.c index b2f34c1b806..f8b07072ad0 100644 --- a/sys/netinet/tcp_subr.c +++ b/sys/netinet/tcp_subr.c @@ -1170,10 +1170,11 @@ tcp_ctlinput(cmd, sa, vip) /* * If no alternative MTU was * proposed, try the next smaller - * one. + * one. ip->ip_len has already + * been swapped in icmp_input(). */ if (!mtu) - mtu = ip_next_mtu(ntohs(ip->ip_len), + mtu = ip_next_mtu(ip->ip_len, 1); if (mtu < max(296, (tcp_minmss) + sizeof(struct tcpiphdr))) diff --git a/sys/netinet/tcp_timewait.c b/sys/netinet/tcp_timewait.c index b2f34c1b806..f8b07072ad0 100644 --- a/sys/netinet/tcp_timewait.c +++ b/sys/netinet/tcp_timewait.c @@ -1170,10 +1170,11 @@ tcp_ctlinput(cmd, sa, vip) /* * If no alternative MTU was * proposed, try the next smaller - * one. + * one. ip->ip_len has already + * been swapped in icmp_input(). */ if (!mtu) - mtu = ip_next_mtu(ntohs(ip->ip_len), + mtu = ip_next_mtu(ip->ip_len, 1); if (mtu < max(296, (tcp_minmss) + sizeof(struct tcpiphdr)))