[NETFILTER] fix leak of fragment queue at unloading nf_conntrack_ipv6

This patch makes nf_conntrack_ipv6 free all IPv6 fragment queues at module
unloading time.  Also introduce a BUG_ON if we ever again have leaks in
the memory accounting.

Signed-off-by: Yasuyuki Kozakai <[EMAIL PROTECTED]>
Signed-off-by: Harald Welte <[EMAIL PROTECTED]>

---
commit 34e9a28a3319e5d7fcb9bc609f46ed02cea65c52
tree 87f3566b05e67a079872afec445c76b905137b3a
parent 46f4ae4ee9d28279e33c6ba6c95f2921f1b39446
author Yasuyuki Kozakai <[EMAIL PROTECTED]> Sun, 13 Nov 2005 22:02:36 +0100
committer Harald Welte <[EMAIL PROTECTED]> Sun, 13 Nov 2005 22:02:36 +0100

 net/ipv6/netfilter/nf_conntrack_reasm.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/net/ipv6/netfilter/nf_conntrack_reasm.c 
b/net/ipv6/netfilter/nf_conntrack_reasm.c
--- a/net/ipv6/netfilter/nf_conntrack_reasm.c
+++ b/net/ipv6/netfilter/nf_conntrack_reasm.c
@@ -282,6 +282,7 @@ static void nf_ct_frag6_evictor(void)
                        return;
                }
                tmp = nf_ct_frag6_lru_list.next;
+               BUG_ON(tmp == NULL);
                fq = list_entry(tmp, struct nf_ct_frag6_queue, lru_list);
                atomic_inc(&fq->refcnt);
                read_unlock(&nf_ct_frag6_lock);
@@ -891,5 +892,6 @@ int nf_ct_frag6_init(void)
 void nf_ct_frag6_cleanup(void)
 {
        del_timer(&nf_ct_frag6_secret_timer);
+       nf_ct_frag6_low_thresh = 0;
        nf_ct_frag6_evictor();
 }

--
- Harald Welte <[EMAIL PROTECTED]>                 http://netfilter.org/
============================================================================
  "Fragmentation is like classful addressing -- an interesting early
   architectural error that shows how much experimentation was going
   on while IP was being designed."                    -- Paul Vixie
-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to