Lines 1339-1347
inp_block_unblock_source(struct inpcb *i
Link Here
|
1339 |
ssa->sin.sin_len = sizeof(struct sockaddr_in); |
1339 |
ssa->sin.sin_len = sizeof(struct sockaddr_in); |
1340 |
ssa->sin.sin_addr = mreqs.imr_sourceaddr; |
1340 |
ssa->sin.sin_addr = mreqs.imr_sourceaddr; |
1341 |
|
1341 |
|
1342 |
if (!in_nullhost(mreqs.imr_interface)) |
1342 |
if (!in_nullhost(mreqs.imr_interface)) { |
|
|
1343 |
IN_IFADDR_RLOCK(); |
1343 |
INADDR_TO_IFP(mreqs.imr_interface, ifp); |
1344 |
INADDR_TO_IFP(mreqs.imr_interface, ifp); |
1344 |
|
1345 |
IN_IFADDR_RUNLOCK(); |
|
|
1346 |
} |
1345 |
if (sopt->sopt_name == IP_BLOCK_SOURCE) |
1347 |
if (sopt->sopt_name == IP_BLOCK_SOURCE) |
1346 |
doblock = 1; |
1348 |
doblock = 1; |
1347 |
|
1349 |
|
Lines 1836-1842
inp_getmoptions(struct inpcb *inp, struc
Link Here
|
1836 |
* |
1838 |
* |
1837 |
* Returns NULL if no ifp could be found. |
1839 |
* Returns NULL if no ifp could be found. |
1838 |
* |
1840 |
* |
1839 |
* SMPng: TODO: Acquire the appropriate locks for INADDR_TO_IFP. |
|
|
1840 |
* FUTURE: Implement IPv4 source-address selection. |
1841 |
* FUTURE: Implement IPv4 source-address selection. |
1841 |
*/ |
1842 |
*/ |
1842 |
static struct ifnet * |
1843 |
static struct ifnet * |
Lines 1851-1857
inp_lookup_mcast_ifp(const struct inpcb
Link Here
|
1851 |
|
1852 |
|
1852 |
ifp = NULL; |
1853 |
ifp = NULL; |
1853 |
if (!in_nullhost(ina)) { |
1854 |
if (!in_nullhost(ina)) { |
|
|
1855 |
IN_IFADDR_RLOCK(); |
1854 |
INADDR_TO_IFP(ina, ifp); |
1856 |
INADDR_TO_IFP(ina, ifp); |
|
|
1857 |
IN_IFADDR_RUNLOCK(); |
1855 |
} else { |
1858 |
} else { |
1856 |
struct route ro; |
1859 |
struct route ro; |
1857 |
|
1860 |
|
Lines 2247-2255
inp_leave_group(struct inpcb *inp, struc
Link Here
|
2247 |
* XXX NOTE WELL: The RFC 3678 API is preferred because |
2250 |
* XXX NOTE WELL: The RFC 3678 API is preferred because |
2248 |
* using an IPv4 address as a key is racy. |
2251 |
* using an IPv4 address as a key is racy. |
2249 |
*/ |
2252 |
*/ |
2250 |
if (!in_nullhost(mreqs.imr_interface)) |
2253 |
if (!in_nullhost(mreqs.imr_interface)) { |
|
|
2254 |
IN_IFADDR_RLOCK(); |
2251 |
INADDR_TO_IFP(mreqs.imr_interface, ifp); |
2255 |
INADDR_TO_IFP(mreqs.imr_interface, ifp); |
2252 |
|
2256 |
IN_IFADDR_RUNLOCK(); |
|
|
2257 |
} |
2253 |
CTR3(KTR_IGMPV3, "%s: imr_interface = %s, ifp = %p", |
2258 |
CTR3(KTR_IGMPV3, "%s: imr_interface = %s, ifp = %p", |
2254 |
__func__, inet_ntoa(mreqs.imr_interface), ifp); |
2259 |
__func__, inet_ntoa(mreqs.imr_interface), ifp); |
2255 |
|
2260 |
|
Lines 2447-2453
inp_set_multicast_if(struct inpcb *inp,
Link Here
|
2447 |
if (in_nullhost(addr)) { |
2452 |
if (in_nullhost(addr)) { |
2448 |
ifp = NULL; |
2453 |
ifp = NULL; |
2449 |
} else { |
2454 |
} else { |
|
|
2455 |
IN_IFADDR_RLOCK(); |
2450 |
INADDR_TO_IFP(addr, ifp); |
2456 |
INADDR_TO_IFP(addr, ifp); |
|
|
2457 |
IN_IFADDR_RUNLOCK(); |
2451 |
if (ifp == NULL) |
2458 |
if (ifp == NULL) |
2452 |
return (EADDRNOTAVAIL); |
2459 |
return (EADDRNOTAVAIL); |
2453 |
} |
2460 |
} |