Acquire address list lock before walking an interface's address list to
identify possible jail addresses on it for IPv4 and IPv6. MFC after: 2 weeks
This commit is contained in:
parent
93c83dd8bf
commit
77ee4c0e00
@ -356,6 +356,7 @@ rtm_get_jailed(struct rt_addrinfo *info, struct ifnet *ifp,
|
||||
* Try to find an address on the given outgoing interface
|
||||
* that belongs to the jail.
|
||||
*/
|
||||
IF_ADDR_LOCK(ifp);
|
||||
TAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) {
|
||||
struct sockaddr *sa;
|
||||
sa = ifa->ifa_addr;
|
||||
@ -367,6 +368,7 @@ rtm_get_jailed(struct rt_addrinfo *info, struct ifnet *ifp,
|
||||
break;
|
||||
}
|
||||
}
|
||||
IF_ADDR_UNLOCK(ifp);
|
||||
if (!found) {
|
||||
/*
|
||||
* As a last resort return the 'default' jail address.
|
||||
@ -394,6 +396,7 @@ rtm_get_jailed(struct rt_addrinfo *info, struct ifnet *ifp,
|
||||
* Try to find an address on the given outgoing interface
|
||||
* that belongs to the jail.
|
||||
*/
|
||||
IF_ADDR_LOCK(ifp);
|
||||
TAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) {
|
||||
struct sockaddr *sa;
|
||||
sa = ifa->ifa_addr;
|
||||
@ -406,6 +409,7 @@ rtm_get_jailed(struct rt_addrinfo *info, struct ifnet *ifp,
|
||||
break;
|
||||
}
|
||||
}
|
||||
IF_ADDR_UNLOCK(ifp);
|
||||
if (!found) {
|
||||
/*
|
||||
* As a last resort return the 'default' jail address.
|
||||
|
Loading…
x
Reference in New Issue
Block a user