diff --git a/sys/netpfil/ipfw/ip_fw_nat.c b/sys/netpfil/ipfw/ip_fw_nat.c index 6693cc533284..a4e1ddf16be7 100644 --- a/sys/netpfil/ipfw/ip_fw_nat.c +++ b/sys/netpfil/ipfw/ip_fw_nat.c @@ -114,10 +114,12 @@ ifaddr_change(void *arg __unused, struct ifnet *ifp) IPFW_UH_WLOCK(chain); /* Check every nat entry... */ LIST_FOREACH(ptr, &chain->nat, _next) { + struct epoch_tracker et; + /* ...using nic 'ifp->if_xname' as dynamic alias address. */ if (strncmp(ptr->if_name, ifp->if_xname, IF_NAMESIZE) != 0) continue; - if_addr_rlock(ifp); + NET_EPOCH_ENTER(et); CK_STAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) { if (ifa->ifa_addr == NULL) continue; @@ -129,7 +131,7 @@ ifaddr_change(void *arg __unused, struct ifnet *ifp) LibAliasSetAddress(ptr->lib, ptr->ip); IPFW_WUNLOCK(chain); } - if_addr_runlock(ifp); + NET_EPOCH_EXIT(et); } IPFW_UH_WUNLOCK(chain); } diff --git a/sys/netpfil/ipfw/nptv6/nptv6.c b/sys/netpfil/ipfw/nptv6/nptv6.c index feeec39ff2c6..b0230f2601f0 100644 --- a/sys/netpfil/ipfw/nptv6/nptv6.c +++ b/sys/netpfil/ipfw/nptv6/nptv6.c @@ -534,6 +534,7 @@ static void nptv6_find_prefix(struct ip_fw_chain *ch, struct nptv6_cfg *cfg, struct ifnet *ifp) { + struct epoch_tracker et; struct ifaddr *ifa; struct in6_ifaddr *ia; @@ -545,7 +546,7 @@ nptv6_find_prefix(struct ip_fw_chain *ch, struct nptv6_cfg *cfg, if (ifp == NULL) return; } - if_addr_rlock(ifp); + NET_EPOCH_ENTER(et); CK_STAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) { if (ifa->ifa_addr->sa_family != AF_INET6) 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); break; } - if_addr_runlock(ifp); + NET_EPOCH_EXIT(et); if_rele(ifp); }