[Openswan dev] Wrong use counter with openswan-2.4.5dr3 and previous using 2.4.x kernel

Matthias Haas mh at pompase.net
Thu Dec 1 13:52:35 CET 2005

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 
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-devel/linux/net/ipsec/ipsec_rcv.c Fri Oct 21 04:22:29  
+++ openswan-2.4.5dr3/linux/net/ipsec/ipsec_rcv.c       Thu Dec  1 12:41:45  
@@ -1196,7 +1196,6 @@  
-       KLIPS_DEC_USE;  
Kind regards  

More information about the Dev mailing list