Author: glebius
Date: Mon Oct 14 16:37:00 2019
New Revision: 353494
URL: https://svnweb.freebsd.org/changeset/base/353494

Log:
  ipfw(4) rule matching always happens in network epoch.

Modified:
  head/sys/netpfil/ipfw/ip_fw2.c

Modified: head/sys/netpfil/ipfw/ip_fw2.c
==============================================================================
--- head/sys/netpfil/ipfw/ip_fw2.c      Mon Oct 14 15:52:59 2019        
(r353493)
+++ head/sys/netpfil/ipfw/ip_fw2.c      Mon Oct 14 16:37:00 2019        
(r353494)
@@ -408,17 +408,15 @@ iface_match(struct ifnet *ifp, ipfw_insn_if *cmd, stru
 #if !defined(USERSPACE) && defined(__FreeBSD__)        /* and OSX too ? */
                struct ifaddr *ia;
 
-               if_addr_rlock(ifp);
+               NET_EPOCH_ASSERT();
+
                CK_STAILQ_FOREACH(ia, &ifp->if_addrhead, ifa_link) {
                        if (ia->ifa_addr->sa_family != AF_INET)
                                continue;
                        if (cmd->p.ip.s_addr == ((struct sockaddr_in *)
-                           (ia->ifa_addr))->sin_addr.s_addr) {
-                               if_addr_runlock(ifp);
-                               return(1);      /* match */
-                       }
+                           (ia->ifa_addr))->sin_addr.s_addr)
+                               return (1);     /* match */
                }
-               if_addr_runlock(ifp);
 #endif /* __FreeBSD__ */
        }
        return(0);      /* no match, fail ... */
_______________________________________________
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to