Check the correct TTL in both the IPv6 and IPv4 cases.

Submitted by:	glebius
Reviewed by:	gnn, bz
Found with:     Coverity Prevent(tm)
This commit is contained in:
George V. Neville-Neil 2006-01-14 16:39:31 +00:00
parent 9cbec74dcb
commit 34f83c52e7
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=154366
2 changed files with 16 additions and 4 deletions

View File

@ -743,8 +743,14 @@ 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;
#endif
if (inp->inp_ip_minttl > ip->ip_ttl)
goto drop;
}
if (inp->inp_vflag & INP_TIMEWAIT) {
/*

View File

@ -743,8 +743,14 @@ 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;
#endif
if (inp->inp_ip_minttl > ip->ip_ttl)
goto drop;
}
if (inp->inp_vflag & INP_TIMEWAIT) {
/*