Changeset View
Changeset View
Standalone View
Standalone View
sys/netinet/in_pcb.c
Show First 20 Lines • Show All 192 Lines • ▼ Show 20 Lines | |||||
*/ | */ | ||||
if (first > last) { | if (first > last) { | ||||
aux = first; | aux = first; | ||||
first = last; | first = last; | ||||
last = aux; | last = aux; | ||||
} | } | ||||
#ifdef INET | #ifdef INET | ||||
laddr.s_addr = INADDR_ANY; | laddr.s_addr = INADDR_ANY; /* will be used by ipv6 branch later too */ | ||||
if ((inp->inp_vflag & (INP_IPV4|INP_IPV6)) == INP_IPV4) { | if ((inp->inp_vflag & (INP_IPV4|INP_IPV6)) == INP_IPV4) { | ||||
if (lsa != NULL) | if (lsa != NULL) | ||||
laddr = ((struct sockaddr_in *)lsa)->sin_addr; | laddr = ((struct sockaddr_in *)lsa)->sin_addr; | ||||
if (fsa != NULL) | if (fsa != NULL) | ||||
faddr = ((struct sockaddr_in *)fsa)->sin_addr; | faddr = ((struct sockaddr_in *)fsa)->sin_addr; | ||||
} | } | ||||
#endif | #endif | ||||
#ifdef INET6 | #ifdef INET6 | ||||
Show All 34 Lines | |||||
if (lsa->sa_family == AF_INET6) { | if (lsa->sa_family == AF_INET6) { | ||||
tmpinp = in6_pcblookup_hash_locked(pcbinfo, | tmpinp = in6_pcblookup_hash_locked(pcbinfo, | ||||
faddr6, fport, laddr6, lport, lookupflags, | faddr6, fport, laddr6, lport, lookupflags, | ||||
NULL, M_NODOM); | NULL, M_NODOM); | ||||
} | } | ||||
#endif | #endif | ||||
} else { | } else { | ||||
#ifdef INET6 | #ifdef INET6 | ||||
if ((inp->inp_vflag & INP_IPV6) != 0) | if ((inp->inp_vflag & INP_IPV6) != 0) { | ||||
tmpinp = in6_pcblookup_local(pcbinfo, | tmpinp = in6_pcblookup_local(pcbinfo, | ||||
&inp->in6p_laddr, lport, lookupflags, cred); | &inp->in6p_laddr, lport, lookupflags, NULL); | ||||
#ifdef INET | |||||
if (tmpinp == NULL && | |||||
(inp->inp_flags & IN6P_IPV6_V6ONLY) == 0 | |||||
&& IN6_IS_ADDR_UNSPECIFIED(&inp->in6p_laddr)) | |||||
tmpinp = in_pcblookup_local(pcbinfo, | |||||
laddr, lport, lookupflags, NULL); | |||||
#endif | |||||
} | |||||
#endif | #endif | ||||
#if defined(INET) && defined(INET6) | #if defined(INET) && defined(INET6) | ||||
else | else | ||||
#endif | #endif | ||||
#ifdef INET | #ifdef INET | ||||
tmpinp = in_pcblookup_local(pcbinfo, laddr, | tmpinp = in_pcblookup_local(pcbinfo, laddr, | ||||
lport, lookupflags, cred); | lport, lookupflags, NULL); | ||||
#endif | #endif | ||||
} | } | ||||
} while (tmpinp != NULL); | } while (tmpinp != NULL); | ||||
*lportp = lport; | *lportp = lport; | ||||
return (0); | return (0); | ||||
} | } | ||||
▲ Show 20 Lines • Show All 192 Lines • Show Last 20 Lines |