correct bad TTL with packets generated by v4 mapped udp. from kame

This commit is contained in:
Jun-ichiro itojun Hagino 2000-06-22 16:48:59 +00:00
parent e7161f368a
commit a8ceb7b389

View File

@ -647,6 +647,13 @@ udp6_attach(struct socket *so, int proto, struct proc *p)
inp->inp_vflag |= INP_IPV6;
inp->in6p_hops = -1; /* use kernel default */
inp->in6p_cksum = -1; /* just to be sure */
/*
* XXX: ugly!!
* 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;
#ifdef IPSEC
error = ipsec_init_policy(so, &inp->in6p_sp);
if (error != 0) {