]> git.ipfire.org Git - thirdparty/nftables.git/commit
netlink_linearize: use range expression for OP_EQ and OP_IMPLICIT
authorPablo Neira Ayuso <pablo@netfilter.org>
Mon, 17 Feb 2025 09:23:24 +0000 (10:23 +0100)
committerPablo Neira Ayuso <pablo@netfilter.org>
Fri, 21 Feb 2025 22:23:16 +0000 (23:23 +0100)
commit50741c52fe57fd09fa9cbd1a1626bfdd2f4115d8
treea646a07e43d8f6de2ccec8b4d5ed4c5954618fdc
parent347039f64509e77ad5f6ef52ae70950c91886f8e
netlink_linearize: use range expression for OP_EQ and OP_IMPLICIT

range expression is available since v4.9-rc1~127^2~67^2~3, replace the
two cmp expression when generating netlink bytecode.

Code to delinearize the two cmp expressions to represent the range
remains in place for backwards compatibility.

The delinearize path to parse range expressions with NFT_OP_EQ is
already present since:

 3ed932917cc7 ("src: use new range expression for != [a,b] intervals")

Update tests/py payload accordingly, json tests need no update since
they already use the range to represent them.

Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
44 files changed:
src/netlink_linearize.c
tests/py/any/ct.t.payload
tests/py/any/meta.t.payload
tests/py/arp/arp.t.payload
tests/py/arp/arp.t.payload.netdev
tests/py/bridge/vlan.t.payload
tests/py/bridge/vlan.t.payload.netdev
tests/py/inet/ah.t.payload
tests/py/inet/comp.t.payload
tests/py/inet/dccp.t.payload
tests/py/inet/esp.t.payload
tests/py/inet/ipsec.t.payload
tests/py/inet/sctp.t.payload
tests/py/inet/tcp.t.payload
tests/py/inet/udp.t.payload
tests/py/inet/udplite.t.payload
tests/py/ip/dnat.t.payload.ip
tests/py/ip/icmp.t.payload.ip
tests/py/ip/igmp.t.payload
tests/py/ip/ip.t.payload
tests/py/ip/ip.t.payload.bridge
tests/py/ip/ip.t.payload.inet
tests/py/ip/ip.t.payload.netdev
tests/py/ip/masquerade.t.payload
tests/py/ip/redirect.t.payload
tests/py/ip/snat.t.payload
tests/py/ip6/dnat.t.payload.ip6
tests/py/ip6/dst.t.payload.inet
tests/py/ip6/dst.t.payload.ip6
tests/py/ip6/frag.t.payload.inet
tests/py/ip6/frag.t.payload.ip6
tests/py/ip6/frag.t.payload.netdev
tests/py/ip6/hbh.t.payload.inet
tests/py/ip6/hbh.t.payload.ip6
tests/py/ip6/icmpv6.t.payload.ip6
tests/py/ip6/ip6.t.payload.inet
tests/py/ip6/ip6.t.payload.ip6
tests/py/ip6/masquerade.t.payload.ip6
tests/py/ip6/mh.t.payload.inet
tests/py/ip6/mh.t.payload.ip6
tests/py/ip6/redirect.t.payload.ip6
tests/py/ip6/rt.t.payload.inet
tests/py/ip6/rt.t.payload.ip6
tests/py/ip6/snat.t.payload.ip6