[Openswan dev]

Matthias Haas mh at pompase.net
Fri Dec 2 11:00:00 CET 2005


 
Compared with an older version where the problem did not exist (I used 2.1.4) 
it seems to me that only the function ipsec_rcv used to have the use counter. 
This should still be the case in the current version. Comparing code 
fragments of the new function ipsec_rcv_decap, it seems to origin from a code 
of the old ipsec_rcv.  
Another point for this assumption is that the function ipsec_rcv_decap is 
only called from within ipsec_rcv where the use counter is already increased 
and at the end decreased, where in my option there is no need to additionally 
in/decrease the use counter of that new function. So I think that this patch 
should do what it was meant to, fix that problem :-). 
 
Kind regards 
Matthias 
 
On Thu, 1 Dec 2005 19:14:18 +0200, Norman Rasmussen wrote 
> I think that maybe KLIPS_INC_USE should be added instead of 
> KLIPS_DEC_USE removed, thoughts? 
>  
> On 12/1/05, Matthias Haas <mh at pompase.net> wrote: 
> > Hello, 
> > I think I found the cause for the extrem decreasing of the module's use 
> > counter when using the current openswan code with kernel 2.4. The defines 
> > KLIPS_INC_USE and KLIPS_DEC_USE are empty while using a 2.6 kernel as 
defined 
> > in linux/include/ipsec_kern24.h. With 2.4 kernels these ones are attached 
to 
> > the use counter. As you can see in the following patch there is only a 
single 
> > decrease with no increase. As the function ipsec_rcv_decap is called 
pretty 
> > often the use counter gets decreased with every package. 
> > I am not sure whether the use counter is needed in this method but if not 
> > this patch removes it. As I am not too deep into the code I can not 
assure 
> > that this is the right way or it is necessary to increase the use counter 
at 
> > the beginning of that function. At my current point of testing I did not 
have 
> > any 
> > trouble with crashing while unloading the ipsec module. So have fun. 
> > 
> > @openswan maintainers: Is there already a bug report regarding this 
issue. If 
> > not I could set a ticket at bugs.openswan.org 
> > 
> > 
> > diff -Naur openswan-2.4.5dr3-devel/linux/net/ipsec/ipsec_rcv.c 
> > openswan-2.4.5dr3/linux/net/ipsec/ipsec_rcv.c 
> > --- openswan-2.4.5dr3-devel/linux/net/ipsec/ipsec_rcv.c Fri Oct 21 
04:22:29 
> > 2005 
> > +++ openswan-2.4.5dr3/linux/net/ipsec/ipsec_rcv.c       Thu Dec  1 
12:41:45 
> > 2005 
> > @@ -1196,7 +1196,6 @@ 
> >                 ipsec_kfree_skb(skb); 
> >         } 
> > 
> > -       KLIPS_DEC_USE; 
> >         return(0); 
> >  } 
> > 
> > Kind regards 
> > Matthias 
> > 
> > _______________________________________________ 
> > Dev mailing list 
> > Dev at openswan.org 
> > http://lists.openswan.org/mailman/listinfo/dev 
> > 
>  
> -- 
> - Norman Rasmussen 
>  - Email: norman at rasmussen.co.za 
>  - Home page: http://norman.rasmussen.co.za/ 
 
 
 


More information about the Dev mailing list