提交 302fe175 编写于 作者: Y Yasuyuki Kozakai 提交者: David S. Miller

[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: NYasuyuki Kozakai <yasuyuki.kozakai@toshiba.co.jp>
Signed-off-by: NHarald Welte <laforge@netfilter.org>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 1ba430bc
...@@ -282,6 +282,7 @@ static void nf_ct_frag6_evictor(void) ...@@ -282,6 +282,7 @@ static void nf_ct_frag6_evictor(void)
return; return;
} }
tmp = nf_ct_frag6_lru_list.next; tmp = nf_ct_frag6_lru_list.next;
BUG_ON(tmp == NULL);
fq = list_entry(tmp, struct nf_ct_frag6_queue, lru_list); fq = list_entry(tmp, struct nf_ct_frag6_queue, lru_list);
atomic_inc(&fq->refcnt); atomic_inc(&fq->refcnt);
read_unlock(&nf_ct_frag6_lock); read_unlock(&nf_ct_frag6_lock);
...@@ -891,5 +892,6 @@ int nf_ct_frag6_init(void) ...@@ -891,5 +892,6 @@ int nf_ct_frag6_init(void)
void nf_ct_frag6_cleanup(void) void nf_ct_frag6_cleanup(void)
{ {
del_timer(&nf_ct_frag6_secret_timer); del_timer(&nf_ct_frag6_secret_timer);
nf_ct_frag6_low_thresh = 0;
nf_ct_frag6_evictor(); nf_ct_frag6_evictor();
} }
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册