]> git.ipfire.org Git - thirdparty/nftables.git/commit
netlink_delinearize: Refactor meta_may_dependency_kill()
authorPhil Sutter <phil@nwl.cc>
Thu, 21 Jun 2018 12:01:13 +0000 (14:01 +0200)
committerFlorian Westphal <fw@strlen.de>
Tue, 26 Jun 2018 14:23:21 +0000 (16:23 +0200)
commit056aaa3e6dc65aced5e552233ac3e7f89fb81f86
treeb3fc68dd87fcf94f8b5f10c23eae216e67245de8
parent78ba4ffdeacc9b31f7396d72c98907e861024653
netlink_delinearize: Refactor meta_may_dependency_kill()

The original intent was to fix a bug: The following rule in inet table:

| meta nfproto ipv4 icmpv6 type echo-reply

Was added correctly but when printing the meta match was falsely
removed. The fix is to deny dependency killing if RHS family of nfproto
match doesn't match RHS family of l4proto match. Adding this to the
already large conditional led to even more unreadable code, therefore
this patch tries to clean that up (and also removes the partial code
duplication.

Signed-off-by: Phil Sutter <phil@nwl.cc>
Signed-off-by: Florian Westphal <fw@strlen.de>
src/netlink_delinearize.c
tests/py/inet/icmp.t [new file with mode: 0644]
tests/py/inet/icmp.t.json [new file with mode: 0644]
tests/py/inet/icmp.t.json.output [new file with mode: 0644]
tests/py/inet/icmp.t.payload [new file with mode: 0644]