Changeset View
Changeset View
Standalone View
Standalone View
sys/netinet6/ip6_output.c
Show First 20 Lines • Show All 2,061 Lines • ▼ Show 20 Lines | #endif | ||||
error = sooptcopyout(sopt, &optval, | error = sooptcopyout(sopt, &optval, | ||||
sizeof optval); | sizeof optval); | ||||
break; | break; | ||||
case IPV6_PATHMTU: | case IPV6_PATHMTU: | ||||
{ | { | ||||
u_long pmtu = 0; | u_long pmtu = 0; | ||||
struct ip6_mtuinfo mtuinfo; | struct ip6_mtuinfo mtuinfo; | ||||
struct in6_addr addr; | |||||
if (!(so->so_state & SS_ISCONNECTED)) | if (!(so->so_state & SS_ISCONNECTED)) | ||||
return (ENOTCONN); | return (ENOTCONN); | ||||
/* | /* | ||||
* XXX: we dot not consider the case of source | * XXX: we dot not consider the case of source | ||||
* routing, or optional information to specify | * routing, or optional information to specify | ||||
* the outgoing interface. | * the outgoing interface. | ||||
* Copy faddr out of in6p to avoid holding lock | |||||
* on inp during route lookup. | |||||
*/ | */ | ||||
INP_RLOCK(in6p); | |||||
bcopy(&in6p->in6p_faddr, &addr, sizeof(addr)); | |||||
INP_RUNLOCK(in6p); | |||||
error = ip6_getpmtu_ctl(so->so_fibnum, | error = ip6_getpmtu_ctl(so->so_fibnum, | ||||
&in6p->in6p_faddr, &pmtu); | &addr, &pmtu); | ||||
if (error) | if (error) | ||||
break; | break; | ||||
if (pmtu > IPV6_MAXPACKET) | if (pmtu > IPV6_MAXPACKET) | ||||
pmtu = IPV6_MAXPACKET; | pmtu = IPV6_MAXPACKET; | ||||
bzero(&mtuinfo, sizeof(mtuinfo)); | bzero(&mtuinfo, sizeof(mtuinfo)); | ||||
mtuinfo.ip6m_mtu = (u_int32_t)pmtu; | mtuinfo.ip6m_mtu = (u_int32_t)pmtu; | ||||
optdata = (void *)&mtuinfo; | optdata = (void *)&mtuinfo; | ||||
▲ Show 20 Lines • Show All 1,013 Lines • Show Last 20 Lines |