Looks like the patch was filtered out from the original message.
So here it is in the body.

Index: net/if_pfsync.c
===================================================================
RCS file: /cvs/src/sys/net/if_pfsync.c,v
retrieving revision 1.195
diff -u -r1.195 if_pfsync.c
--- net/if_pfsync.c     30 Oct 2012 12:09:05 -0000      1.195
+++ net/if_pfsync.c     2 May 2013 16:50:36 -0000
@@ -613,7 +613,7 @@
        if (!ISSET(flags, PFSYNC_SI_IOCTL))
                SET(st->state_flags, PFSTATE_NOSYNC);
 
-       if (pf_state_insert(kif, skw, sks, st) != 0) {
+       if (pf_state_insert(kif, &skw, &sks, st) != 0) {
                /* XXX when we have anchors, use STATE_DEC_COUNTERS */
                r->states_cur--;
                error = EEXIST;
Index: net/pf.c
===================================================================
RCS file: /cvs/src/sys/net/pf.c,v
retrieving revision 1.818
diff -u -r1.818 pf.c
--- net/pf.c    20 Jan 2013 22:51:16 -0000      1.818
+++ net/pf.c    2 May 2013 16:50:38 -0000
@@ -667,9 +667,10 @@
 }
 
 int
-pf_state_key_attach(struct pf_state_key *sk, struct pf_state *s, int
idx) +pf_state_key_attach(struct pf_state_key **skp, struct pf_state
*s, int idx) {
        struct pf_state_item    *si;
+       struct pf_state_key     *sk = *skp;
        struct pf_state_key     *cur;
        struct pf_state         *olds = NULL;
 
@@ -718,6 +719,7 @@
                        }
                pool_put(&pf_state_key_pl, sk);
                s->key[idx] = cur;
+               *skp = cur;
        } else
                s->key[idx] = sk;
 
@@ -916,13 +918,13 @@
 }
 
 int
-pf_state_insert(struct pfi_kif *kif, struct pf_state_key *skw,
-    struct pf_state_key *sks, struct pf_state *s)
+pf_state_insert(struct pfi_kif *kif, struct pf_state_key **skw,
+    struct pf_state_key **sks, struct pf_state *s)
 {
        splsoftassert(IPL_SOFTNET);
 
        s->kif = kif;
-       if (skw == sks) {
+       if (*skw == *sks) {
                if (pf_state_key_attach(skw, s, PF_SK_WIRE))
                        return (-1);
                s->key[PF_SK_STACK] = s->key[PF_SK_WIRE];
@@ -3790,7 +3792,7 @@
                goto csfailed;
        }
 
-       if (pf_state_insert(BOUND_IFACE(r, pd->kif), *skw, *sks, s)) {
+       if (pf_state_insert(BOUND_IFACE(r, pd->kif), skw, sks, s)) {
                pf_state_key_detach(s, PF_SK_STACK);
                pf_state_key_detach(s, PF_SK_WIRE);
                *sks = *skw = NULL;
Index: net/pfvar.h
===================================================================
RCS file: /cvs/src/sys/net/pfvar.h,v
retrieving revision 1.376
diff -u -r1.376 pfvar.h
--- net/pfvar.h 17 Jan 2013 00:48:04 -0000      1.376
+++ net/pfvar.h 2 May 2013 16:50:39 -0000
@@ -1746,8 +1746,8 @@
 extern void                     pf_unlink_state(struct pf_state *);
 extern void                     pf_free_state(struct pf_state *);
 extern int                      pf_state_insert(struct pfi_kif *,
-                                   struct pf_state_key *,
-                                   struct pf_state_key *,
+                                   struct pf_state_key **,
+                                   struct pf_state_key **,
                                    struct pf_state *);
 int                             pf_insert_src_node(struct
pf_src_node **, struct pf_rule *, enum pf_sn_types,
@@ -1827,7 +1827,7 @@
 int    pf_socket_lookup(struct pf_pdesc *);
 struct pf_state_key *pf_alloc_state_key(int);
 void   pf_pkt_addr_changed(struct mbuf *);
-int    pf_state_key_attach(struct pf_state_key *, struct pf_state
*, int); +int   pf_state_key_attach(struct pf_state_key **, struct
pf_state *, int); int   pf_translate(struct pf_pdesc *, struct
pf_addr *, u_int16_t, struct pf_addr *, u_int16_t, u_int16_t, int);
 int    pf_translate_af(struct pf_pdesc *);


-- 
Vitaly Sinilin <[email protected]>

Reply via email to