Changeset View
Changeset View
Standalone View
Standalone View
sys/netinet/in_pcb.c
Show First 20 Lines • Show All 926 Lines • ▼ Show 20 Lines | in_pcbbind_setup(struct inpcb *inp, struct sockaddr *nam, in_addr_t *laddrp, | ||||
int reuseport_lb = (so->so_options & SO_REUSEPORT_LB); | int reuseport_lb = (so->so_options & SO_REUSEPORT_LB); | ||||
/* | /* | ||||
* No state changes, so read locks are sufficient here. | * No state changes, so read locks are sufficient here. | ||||
*/ | */ | ||||
INP_LOCK_ASSERT(inp); | INP_LOCK_ASSERT(inp); | ||||
INP_HASH_LOCK_ASSERT(pcbinfo); | INP_HASH_LOCK_ASSERT(pcbinfo); | ||||
if (CK_STAILQ_EMPTY(&V_in_ifaddrhead)) /* XXX broken! */ | |||||
return (EADDRNOTAVAIL); | |||||
laddr.s_addr = *laddrp; | laddr.s_addr = *laddrp; | ||||
if (nam != NULL && laddr.s_addr != INADDR_ANY) | if (nam != NULL && laddr.s_addr != INADDR_ANY) | ||||
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_ip4(cred, &laddr)) != 0) | if ((error = prison_local_ip4(cred, &laddr)) != 0) | ||||
return (error); | return (error); | ||||
▲ Show 20 Lines • Show All 2,599 Lines • Show Last 20 Lines |