]> git.baikalelectronics.ru Git - kernel.git/commit
netfilter: nf_tables: fix error handling of rule replacement
authorPablo Neira Ayuso <pablo@netfilter.org>
Wed, 4 Mar 2015 16:55:27 +0000 (17:55 +0100)
committerPablo Neira Ayuso <pablo@netfilter.org>
Wed, 4 Mar 2015 17:46:08 +0000 (18:46 +0100)
commitbc3603049896affa91e7781f24c849c943e2b003
treed128e560d9936517baaf94261444682fae727097
parent96e3a9c78b831a76763a25a8f8b674a41b66df69
netfilter: nf_tables: fix error handling of rule replacement

In general, if a transaction object is added to the list successfully,
we can rely on the abort path to undo what we've done. This allows us to
simplify the error handling of the rule replacement path in
nf_tables_newrule().

This implicitly fixes an unnecessary removal of the old rule, which
needs to be left in place if we fail to replace.

Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
net/netfilter/nf_tables_api.c