Author: glebius
Date: Mon Nov  4 08:20:06 2013
New Revision: 257620
URL: http://svnweb.freebsd.org/changeset/base/257620

Log:
  Code logic of handling PFTM_PURGE into pf_find_state().

Modified:
  head/sys/netpfil/pf/pf.c

Modified: head/sys/netpfil/pf/pf.c
==============================================================================
--- head/sys/netpfil/pf/pf.c    Mon Nov  4 08:15:59 2013        (r257619)
+++ head/sys/netpfil/pf/pf.c    Mon Nov  4 08:20:06 2013        (r257620)
@@ -318,7 +318,7 @@ enum { PF_ICMP_MULTI_NONE, PF_ICMP_MULTI
 #define        STATE_LOOKUP(i, k, d, s, pd)                                    
\
        do {                                                            \
                (s) = pf_find_state((i), (k), (d));                     \
-               if ((s) == NULL || (s)->timeout == PFTM_PURGE)          \
+               if ((s) == NULL)                                        \
                        return (PF_DROP);                               \
                if (PACKET_LOOPED(pd))                                  \
                        return (PF_PASS);                               \
@@ -1230,11 +1230,11 @@ pf_find_state(struct pfi_kif *kif, struc
                if (s->kif == V_pfi_all || s->kif == kif) {
                        PF_STATE_LOCK(s);
                        PF_HASHROW_UNLOCK(kh);
-                       if (s->timeout == PFTM_UNLINKED) {
+                       if (s->timeout >= PFTM_MAX) {
                                /*
-                                * State is being processed
-                                * by pf_unlink_state() in
-                                * an other thread.
+                                * State is either being processed by
+                                * pf_unlink_state() in an other thread, or
+                                * is scheduled for immediate expiry.
                                 */
                                PF_STATE_UNLOCK(s);
                                return (NULL);
_______________________________________________
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to