Re: ipf 4.1.5 badnat / memory leak

This is a discussion on Re: ipf 4.1.5 badnat / memory leak within the IPFilter forums, part of the System Security and Security Related category; I had a look at that patch and while it's very neat and clean, I'd rather not be ...


Go Back   Usenet Forums > System Security and Security Related > IPFilter

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 02-16-2005
Darren Reed
 
Posts: n/a
Default Re: ipf 4.1.5 badnat / memory leak


I had a look at that patch and while it's very neat and clean,
I'd rather not be free'ing the mbuf in so many places, so I
jiggled around with the code a little.

Did you have any sort of test rig to verify this? If so,
can you please try the patch below if you think it also fixes
the problem?

Thanks,
Darren

Index: fil.c
================================================== =================
RCS file: /devel/CVS/IP-Filter/fil.c,v
retrieving revision 2.243.2.49
diff -u -r2.243.2.49 fil.c
--- fil.c 4 Feb 2005 09:44:36 -0000 2.243.2.49
+++ fil.c 16 Feb 2005 13:03:18 -0000
@@ -2416,12 +2416,6 @@
#endif
m = fin->fin_m;

- if (FR_ISPASS(pass)) {
- ATOMIC_INCL(frstats[out].fr_pass);
- } else if (FR_ISBLOCK(pass)) {
- ATOMIC_INCL(frstats[out].fr_block);
- }
-
if (fr != NULL) {
frdest_t *fdp;

@@ -2453,21 +2447,23 @@
*/
RWLOCK_EXIT(&ipf_mutex);

+finished:
if (!FR_ISPASS(pass)) {
+ ATOMIC_INCL(frstats[out].fr_block);
if (*mp != NULL) {
FREE_MB_T(*mp);
m = *mp = NULL;
}
- }
+ } else {
+ ATOMIC_INCL(frstats[out].fr_pass);
#if defined(_KERNEL) && defined(__sgi)
- else {
if ((fin->fin_hbuf != NULL) &&
(mtod(fin->fin_m, struct ip *) != fin->fin_ip)) {
COPYBACK(m, 0, fin->fin_plen, fin->fin_hbuf);
}
- }
#endif
-finished:
+ }
+
RWLOCK_EXIT(&ipf_global);
#ifdef _KERNEL
# if OpenBSD >= 200311
Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 03:57 PM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0