Skip to content

Commit

Permalink
[NETFILTER] fix leak of fragment queue at unloading nf_conntrack_ipv6
Browse files Browse the repository at this point in the history
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 <yasuyuki.kozakai@toshiba.co.jp>
Signed-off-by: Harald Welte <laforge@netfilter.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Yasuyuki Kozakai authored and David S. Miller committed Nov 14, 2005
1 parent 1ba430b commit 302fe17
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions net/ipv6/netfilter/nf_conntrack_reasm.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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();
}

0 comments on commit 302fe17

Please sign in to comment.