Use epoch(9) directly instead of obsoleted KPI.
This commit is contained in:
parent
961c033ef1
commit
16a72f53e2
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=353495
@ -114,10 +114,12 @@ ifaddr_change(void *arg __unused, struct ifnet *ifp)
|
|||||||
IPFW_UH_WLOCK(chain);
|
IPFW_UH_WLOCK(chain);
|
||||||
/* Check every nat entry... */
|
/* Check every nat entry... */
|
||||||
LIST_FOREACH(ptr, &chain->nat, _next) {
|
LIST_FOREACH(ptr, &chain->nat, _next) {
|
||||||
|
struct epoch_tracker et;
|
||||||
|
|
||||||
/* ...using nic 'ifp->if_xname' as dynamic alias address. */
|
/* ...using nic 'ifp->if_xname' as dynamic alias address. */
|
||||||
if (strncmp(ptr->if_name, ifp->if_xname, IF_NAMESIZE) != 0)
|
if (strncmp(ptr->if_name, ifp->if_xname, IF_NAMESIZE) != 0)
|
||||||
continue;
|
continue;
|
||||||
if_addr_rlock(ifp);
|
NET_EPOCH_ENTER(et);
|
||||||
CK_STAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) {
|
CK_STAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) {
|
||||||
if (ifa->ifa_addr == NULL)
|
if (ifa->ifa_addr == NULL)
|
||||||
continue;
|
continue;
|
||||||
@ -129,7 +131,7 @@ ifaddr_change(void *arg __unused, struct ifnet *ifp)
|
|||||||
LibAliasSetAddress(ptr->lib, ptr->ip);
|
LibAliasSetAddress(ptr->lib, ptr->ip);
|
||||||
IPFW_WUNLOCK(chain);
|
IPFW_WUNLOCK(chain);
|
||||||
}
|
}
|
||||||
if_addr_runlock(ifp);
|
NET_EPOCH_EXIT(et);
|
||||||
}
|
}
|
||||||
IPFW_UH_WUNLOCK(chain);
|
IPFW_UH_WUNLOCK(chain);
|
||||||
}
|
}
|
||||||
|
@ -534,6 +534,7 @@ static void
|
|||||||
nptv6_find_prefix(struct ip_fw_chain *ch, struct nptv6_cfg *cfg,
|
nptv6_find_prefix(struct ip_fw_chain *ch, struct nptv6_cfg *cfg,
|
||||||
struct ifnet *ifp)
|
struct ifnet *ifp)
|
||||||
{
|
{
|
||||||
|
struct epoch_tracker et;
|
||||||
struct ifaddr *ifa;
|
struct ifaddr *ifa;
|
||||||
struct in6_ifaddr *ia;
|
struct in6_ifaddr *ia;
|
||||||
|
|
||||||
@ -545,7 +546,7 @@ nptv6_find_prefix(struct ip_fw_chain *ch, struct nptv6_cfg *cfg,
|
|||||||
if (ifp == NULL)
|
if (ifp == NULL)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if_addr_rlock(ifp);
|
NET_EPOCH_ENTER(et);
|
||||||
CK_STAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) {
|
CK_STAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) {
|
||||||
if (ifa->ifa_addr->sa_family != AF_INET6)
|
if (ifa->ifa_addr->sa_family != AF_INET6)
|
||||||
continue;
|
continue;
|
||||||
@ -558,7 +559,7 @@ nptv6_find_prefix(struct ip_fw_chain *ch, struct nptv6_cfg *cfg,
|
|||||||
nptv6_set_external(cfg, &ia->ia_addr.sin6_addr);
|
nptv6_set_external(cfg, &ia->ia_addr.sin6_addr);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if_addr_runlock(ifp);
|
NET_EPOCH_EXIT(et);
|
||||||
if_rele(ifp);
|
if_rele(ifp);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user