]> git.baikalelectronics.ru Git - kernel.git/commit
netfilter: nf_tables: reverse order in rule replacement expansion
authorPablo Neira Ayuso <pablo@netfilter.org>
Fri, 24 Sep 2021 22:27:38 +0000 (00:27 +0200)
committerPablo Neira Ayuso <pablo@netfilter.org>
Tue, 28 Sep 2021 11:04:56 +0000 (13:04 +0200)
commit6f4383917a7ec4ba8fff94f644ddf8aab81b9c60
tree817fd061d9ed87935049b38413ec33fdbe53f1ca
parentd4b5dedc22991e3ea32b3698e1aa2d5fa42db34b
netfilter: nf_tables: reverse order in rule replacement expansion

Deactivate old rule first, then append the new rule, so rule replacement
notification via netlink first reports the deletion of the old rule with
handle X in first place, then it adds the new rule (reusing the handle X
of the replaced old rule).

Note that the abort path releases the transaction that has been created
by nft_delrule() on error.

Fixes: f396c47589ad ("netfilter: nf_tables: deactivate expressions in rule replecement routine")
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
net/netfilter/nf_tables_api.c