Re: pf_create_state() is sometimes better to use pf_unlink_state()

2015-06-03 Thread Mike Belopuhov
On Thu, May 28, 2015 at 23:46 +0200, Alexandr Nedvedicky wrote: > > > >> > > >> But we'll drop this "reference" in pf_src_tree_remove_state, > > >> then how will sns[PF_SN_NAT] and sns[PF_SN_ROUTE] be different? > > > > > > I think I should take PF class again ;-) I've just realized there > > > is

Re: pf_create_state() is sometimes better to use pf_unlink_state()

2015-05-28 Thread Alexandr Nedvedicky
> >> > >> But we'll drop this "reference" in pf_src_tree_remove_state, > >> then how will sns[PF_SN_NAT] and sns[PF_SN_ROUTE] be different? > > > > I think I should take PF class again ;-) I've just realized there > > is a test in pf_remove_src_node(): > > > > 572 if (sn->states > 0 ||

Re: pf_create_state() is sometimes better to use pf_unlink_state()

2015-05-28 Thread Mike Belopuhov
On 28 May 2015 at 21:22, Alexandr Nedvedicky wrote: >> > > > sorry I was too brief. The snippet below comes from >> > > > pf_create_state() with your patch applied: >> > > > >> > > >3560 for (i = 0; i < PF_SN_MAX; i++) >> > > >3561 if (sns[i] != NULL) { >> > > >

Re: pf_create_state() is sometimes better to use pf_unlink_state()

2015-05-28 Thread Alexandr Nedvedicky
> > > > sorry I was too brief. The snippet below comes from > > > > pf_create_state() with your patch applied: > > > > > > > >3560 for (i = 0; i < PF_SN_MAX; i++) > > > >3561 if (sns[i] != NULL) { > > > >3562 struct pf_sn_item *sni;

Re: pf_create_state() is sometimes better to use pf_unlink_state()

2015-05-28 Thread Mike Belopuhov
On Thu, May 28, 2015 at 13:34 +0200, Alexandr Nedvedicky wrote: > On Thu, May 28, 2015 at 11:43:02AM +0200, Mike Belopuhov wrote: > > On Thu, May 28, 2015 at 01:17 +0200, Alexandr Nedvedicky wrote: > > > Hello, > > > > > > > > > On Wed, May 27, 2015 at 07:44:15PM +0200, Mike Belopuhov wrote: > >

Re: pf_create_state() is sometimes better to use pf_unlink_state()

2015-05-28 Thread Alexandr Nedvedicky
On Thu, May 28, 2015 at 11:43:02AM +0200, Mike Belopuhov wrote: > On Thu, May 28, 2015 at 01:17 +0200, Alexandr Nedvedicky wrote: > > Hello, > > > > > > On Wed, May 27, 2015 at 07:44:15PM +0200, Mike Belopuhov wrote: > > > On Wed, May 27, 2015 at 10:39 +0200, Alexandr Nedvedicky wrote: > > > > He

Re: pf_create_state() is sometimes better to use pf_unlink_state()

2015-05-28 Thread Mike Belopuhov
On Thu, May 28, 2015 at 01:17 +0200, Alexandr Nedvedicky wrote: > Hello, > > > On Wed, May 27, 2015 at 07:44:15PM +0200, Mike Belopuhov wrote: > > On Wed, May 27, 2015 at 10:39 +0200, Alexandr Nedvedicky wrote: > > > Hello, > > > > > > > > - if (pf_state_insert(BOUND_IFACE(r, pd->kif), skw

Re: pf_create_state() is sometimes better to use pf_unlink_state()

2015-05-27 Thread Alexandr Nedvedicky
Hello, On Wed, May 27, 2015 at 07:44:15PM +0200, Mike Belopuhov wrote: > On Wed, May 27, 2015 at 10:39 +0200, Alexandr Nedvedicky wrote: > > Hello, > > > > > > - if (pf_state_insert(BOUND_IFACE(r, pd->kif), skw, sks, s)) { > > > > - pf_state_key_detach(s, PF_SK_STACK); > > >

Re: pf_create_state() is sometimes better to use pf_unlink_state()

2015-05-27 Thread Mike Belopuhov
On Wed, May 27, 2015 at 10:39 +0200, Alexandr Nedvedicky wrote: > Hello, > > > > - 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); > > > > This bug is not yours,

Re: pf_create_state() is sometimes better to use pf_unlink_state()

2015-05-27 Thread Alexandr Nedvedicky
Hello, > > - 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); > > This bug is not yours, but doing two pf_state_key_detach is wrong > and results in all kinds of prot

Re: pf_create_state() is sometimes better to use pf_unlink_state()

2015-05-26 Thread Mike Belopuhov
On Thu, May 21, 2015 at 21:28 +0200, Alexandr Nedvedicky wrote: > Hello, > > On Thu, May 21, 2015 at 07:43:51PM +0200, Mike Belopuhov wrote: > > On Thu, May 21, 2015 at 17:34 +0200, Alexandr Nedvedicky wrote: > > > Hello, > > > > > > > Hi, > > > > > snippet below comes from pf_create_state(): >

Re: pf_create_state() is sometimes better to use pf_unlink_state()

2015-05-22 Thread Henning Brauer
* Alexandr Nedvedicky [2015-05-21 21:31]: > On Thu, May 21, 2015 at 07:43:51PM +0200, Mike Belopuhov wrote: > > On Thu, May 21, 2015 at 17:34 +0200, Alexandr Nedvedicky wrote: > > > snippet below comes from pf_create_state(): > > > > > >3559 if (pf_state_insert(BOUND_IFACE(r, pd->kif)

Re: pf_create_state() is sometimes better to use pf_unlink_state()

2015-05-21 Thread Alexandr Nedvedicky
Hello, On Thu, May 21, 2015 at 07:43:51PM +0200, Mike Belopuhov wrote: > On Thu, May 21, 2015 at 17:34 +0200, Alexandr Nedvedicky wrote: > > Hello, > > > > Hi, > > > snippet below comes from pf_create_state(): > > > >3559 if (pf_state_insert(BOUND_IFACE(r, pd->kif), skw, sks, s)) {

Re: pf_create_state() is sometimes better to use pf_unlink_state()

2015-05-21 Thread Mike Belopuhov
On Thu, May 21, 2015 at 17:34 +0200, Alexandr Nedvedicky wrote: > Hello, > Hi, > snippet below comes from pf_create_state(): > >3559 if (pf_state_insert(BOUND_IFACE(r, pd->kif), skw, sks, s)) { >3560 pf_state_key_detach(s, PF_SK_STACK); >3561 p

pf_create_state() is sometimes better to use pf_unlink_state()

2015-05-21 Thread Alexandr Nedvedicky
Hello, snippet below comes from pf_create_state(): 3559 if (pf_state_insert(BOUND_IFACE(r, pd->kif), skw, sks, s)) { 3560 pf_state_key_detach(s, PF_SK_STACK); 3561 pf_state_key_detach(s, PF_SK_WIRE); 3562 *sks = *skw = NULL; 3