From afdcfafe550215e9ae4edf3e0c4f0edac6ba23dd Mon Sep 17 00:00:00 2001 From: andre Date: Tue, 31 Jan 2006 16:09:34 +0000 Subject: [PATCH] MFC 1.286 & 1.287: Check the correct TTL in both the IPv6 and IPv4 cases. --- sys/netinet/tcp_input.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/sys/netinet/tcp_input.c b/sys/netinet/tcp_input.c index 7e2eba42e10..c3f87b8864b 100644 --- a/sys/netinet/tcp_input.c +++ b/sys/netinet/tcp_input.c @@ -742,8 +742,15 @@ tcp_input(m, off0) INP_LOCK(inp); /* Check the minimum TTL for socket. */ - if (inp->inp_ip_minttl && inp->inp_ip_minttl > ip->ip_ttl) - goto drop; + if (inp->inp_ip_minttl != 0) { +#ifdef INET6 + if (isipv6 && inp->inp_ip_minttl > ip6->ip6_hlim) + goto drop; + else +#endif + if (inp->inp_ip_minttl > ip->ip_ttl) + goto drop; + } if (inp->inp_vflag & INP_TIMEWAIT) { /* -- 2.45.2