Changeset View
Changeset View
Standalone View
Standalone View
sys/netinet6/in6_pcb.c
Show First 20 Lines • Show All 167 Lines • ▼ Show 20 Lines | in6_pcbbind(struct inpcb *inp, struct sockaddr *nam, | ||||
* XXX: Maybe we could let SO_REUSEPORT_LB set SO_REUSEPORT bit here | * XXX: Maybe we could let SO_REUSEPORT_LB set SO_REUSEPORT bit here | ||||
* so that we don't have to add to the (already messy) code below. | * so that we don't have to add to the (already messy) code below. | ||||
*/ | */ | ||||
int reuseport_lb = (so->so_options & SO_REUSEPORT_LB); | int reuseport_lb = (so->so_options & SO_REUSEPORT_LB); | ||||
INP_WLOCK_ASSERT(inp); | INP_WLOCK_ASSERT(inp); | ||||
INP_HASH_WLOCK_ASSERT(pcbinfo); | INP_HASH_WLOCK_ASSERT(pcbinfo); | ||||
if (CK_STAILQ_EMPTY(&V_in6_ifaddrhead)) /* XXX broken! */ | |||||
return (EADDRNOTAVAIL); | |||||
if (inp->inp_lport || !IN6_IS_ADDR_UNSPECIFIED(&inp->in6p_laddr)) | if (inp->inp_lport || !IN6_IS_ADDR_UNSPECIFIED(&inp->in6p_laddr)) | ||||
return (EINVAL); | return (EINVAL); | ||||
if ((so->so_options & (SO_REUSEADDR|SO_REUSEPORT|SO_REUSEPORT_LB)) == 0) | if ((so->so_options & (SO_REUSEADDR|SO_REUSEPORT|SO_REUSEPORT_LB)) == 0) | ||||
lookupflags = INPLOOKUP_WILDCARD; | lookupflags = INPLOOKUP_WILDCARD; | ||||
if (nam == NULL) { | if (nam == NULL) { | ||||
if ((error = prison_local_ip6(cred, &inp->in6p_laddr, | if ((error = prison_local_ip6(cred, &inp->in6p_laddr, | ||||
((inp->inp_flags & IN6P_IPV6_V6ONLY) != 0))) != 0) | ((inp->inp_flags & IN6P_IPV6_V6ONLY) != 0))) != 0) | ||||
return (error); | return (error); | ||||
▲ Show 20 Lines • Show All 1,260 Lines • Show Last 20 Lines |