]> git.baikalelectronics.ru Git - kernel.git/commit
netfilter: nf_nat_snmp: Fix panic when snmp_trap_helper fails to register
authorGao Feng <fgao@ikuai8.com>
Sat, 25 Mar 2017 10:24:36 +0000 (18:24 +0800)
committerPablo Neira Ayuso <pablo@netfilter.org>
Mon, 27 Mar 2017 11:49:13 +0000 (13:49 +0200)
commitda8787437071646338faa4121b9f761afba4fff2
treee93cd06368bf1578dcc850815b2a2af9bd26ee6b
parent1133c73eaf69ec7fe214b14a0dd5a706f3ec4670
netfilter: nf_nat_snmp: Fix panic when snmp_trap_helper fails to register

In the commit bfeb7960fd7a ("netfilter: nf_conntrack: nf_conntrack snmp
helper"), the snmp_helper is replaced by nf_nat_snmp_hook. So the
snmp_helper is never registered. But it still tries to unregister the
snmp_helper, it could cause the panic.

Now remove the useless snmp_helper and the unregister call in the
error handler.

Fixes: bfeb7960fd7a ("netfilter: nf_conntrack: nf_conntrack snmp helper")
Signed-off-by: Gao Feng <fgao@ikuai8.com>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
net/ipv4/netfilter/nf_nat_snmp_basic.c