1
0
mirror of https://git.FreeBSD.org/src.git synced 2025-01-12 14:29:28 +00:00

Fix the bug that IPv4 ttl is not initialized when AF_INET6 socket is used

for IPv4 communication.(IPv4 mapped IPv6 addr.)
Also removed IPv6 hoplimit initialization because it is alway done at
tcp_output.

Confirmed by: Bernd Walter <ticso@cicely5.cicely.de>
This commit is contained in:
Yoshinobu Inoue 2000-01-25 01:05:18 +00:00
parent 1bd87e1b32
commit e2de10abe4
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=56564
2 changed files with 10 additions and 16 deletions

View File

@ -517,14 +517,11 @@ tcp_newtcpcb(inp)
tp->snd_cwnd = TCP_MAXWIN << TCP_MAX_WINSHIFT;
tp->snd_ssthresh = TCP_MAXWIN << TCP_MAX_WINSHIFT;
tp->t_rcvtime = ticks;
#ifdef INET6
if (isipv6 != 0)
inp->in6p_ip6_hlim = in6_selecthlim(inp,
inp->in6p_route.ro_rt ?
inp->in6p_route.ro_rt->rt_ifp :
NULL);
else
#endif
/*
* IPv4 TTL initialization is necessary for an IPv6 socket as well,
* because the socket may be bound to an IPv6 wildcard address,
* which may match an IPv4-mapped IPv6 address.
*/
inp->inp_ip_ttl = ip_defttl;
inp->inp_ppcb = (caddr_t)tp;
return (tp); /* XXX */

View File

@ -517,14 +517,11 @@ tcp_newtcpcb(inp)
tp->snd_cwnd = TCP_MAXWIN << TCP_MAX_WINSHIFT;
tp->snd_ssthresh = TCP_MAXWIN << TCP_MAX_WINSHIFT;
tp->t_rcvtime = ticks;
#ifdef INET6
if (isipv6 != 0)
inp->in6p_ip6_hlim = in6_selecthlim(inp,
inp->in6p_route.ro_rt ?
inp->in6p_route.ro_rt->rt_ifp :
NULL);
else
#endif
/*
* IPv4 TTL initialization is necessary for an IPv6 socket as well,
* because the socket may be bound to an IPv6 wildcard address,
* which may match an IPv4-mapped IPv6 address.
*/
inp->inp_ip_ttl = ip_defttl;
inp->inp_ppcb = (caddr_t)tp;
return (tp); /* XXX */