Skip to content

Fix netlink debug output on Big Endian

Phil Sutter netfilter-devel 2 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest11 patches 3 repliesIn review
  2. v128 patches 24 repliesSuperseded

Changes in v2 from the cover letter

- First 12 patches accepted and pushed already, patches 27 and 28 as well
- Minimize changes to existing code: Drop patch 13 changing string-based expressions to be defined as Big Endian as well as related patches 14, 17 and 18
- Pull a fix for concatenated wildcard interface names upfront
- Follow with set element sorting changes, with improved patch descriptions and related test suite record changes folded into them for clarification of practical effect
- Review patch descriptions in general
- Add special casing to patch 5 to avoid string-based values being printed in reverse by libnftnl, also communicate any byteorder conversions from __netlink_gen_concat_key() back to caller for the same purpose

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/11segtree: Fix range aggregation on Big Endiansrc/segtree.c+3 -30 replies
2/11mergesort: Fix sorting of string valuessrc/mergesort.c tests/py/any/meta.t.json.output tests/py/any/queue.t.json.output +7 more+84 -772 replies
3/11mergesort: Align concatenation sort order with Big Endiansrc/mergesort.c tests/py/any/ct.t.json.output tests/py/any/tcpopt.t.json.output +19 more+91 -1680 replies
4/11intervals: Convert byte order implicitlysrc/intervals.c+3 -70 replies
5/11expression: Set range expression 'len' fieldsrc/evaluate.c src/expression.c+2 -00 replies
6/11netlink: Introduce struct nft_data_linearize::byteorderinclude/netlink.h src/netlink.c+51 -100 replies
7/11netlink: Introduce struct nft_data_linearize::sizesinclude/netlink.h src/netlink.c+11 -40 replies
8/11netlink: Make use of nftnl_{expr,set_elem}_set_imm()src/netlink.c src/netlink_linearize.c+34 -180 replies
9/11tests: py: tools: Add regen_payloads.shtests/py/tools/regen_payloads.sh+74 -00 replies
10/11tests: py: Update payload recordstests/py/any/ct.t.payload tests/py/any/meta.t.payload tests/py/any/meta.t.payload.bridge +122 more+4385 -44610 replies
11/11utils: Introduce expr_print_debug()include/utils.h+9 -00 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v2 yet.

Read the v2 thread

Cover letter [nft PATCH v2 00/11] Fix netlink debug output on Big Endian

Make use of recent changes to libnftnl to make test suites pass on both Little and Big Endian systems.

Changes since v1:
- First 12 patches accepted and pushed already, patches 27 and 28 as well
- Minimize changes to existing code: Drop patch 13 changing string-based expressions to be defined as Big Endian as well as related patches 14, 17 and 18
- Pull a fix for concatenated wildcard interface names upfront
- Follow with set element sorting changes, with improved patch descriptions and related test suite record changes folded into them for clarification of practical effect
- Review patch descriptions in general
- Add special casing to patch 5 to avoid string-based values being printed in reverse by libnftnl, also communicate any byteorder conversions from __netlink_gen_concat_key() back to caller for the same purpose

Patch 1 works around "funny" behaviour of GMP when partially exporting data and unwanted prefix-padding when exporting into an oversized buffer, all happening on Big Endian only.

Patches 2 and 3 deal with sorting of set elements. They are effective on Little Endian only, changing sort ordering to match that of Big Endian.

Patches 4 and 5 are preparation for the next two patches.

Patches 6 and 7 collect data for calls to newly introduced libnftnl API functions (in patch 8) to communicate byte order and component sizes in data regs to libnftnl.

Patch 10 contains the big payload records update, created with help from the script introduced in patch 9.

Patch 11 still contains the expr_print_debug() macro definition for use with printf-debugging.

Phil Sutter (11):
segtree: Fix range aggregation on Big Endian
mergesort: Fix sorting of string values
mergesort: Align concatenation sort order with Big Endian
intervals: Convert byte order implicitly
expression: Set range expression 'len' field
netlink: Introduce struct nft_data_linearize::byteorder
netlink: Introduce struct nft_data_linearize::sizes
netlink: Make use of nftnl_{expr,set_elem}_set_imm()
tests: py: tools: Add regen_payloads.sh
tests: py: Update payload records
utils: Introduce expr_print_debug()

 include/netlink.h                             |   2 +
 include/utils.h                               |   9 +
 src/evaluate.c                                |   1 +
 src/expression.c                              |   1 +
 src/intervals.c                               |  10 +-
 src/mergesort.c                               |  11 +-
 src/netlink.c                                 |  84 +++-
 src/netlink_linearize.c                       |  34 +-
 src/segtree.c                                 |   6 +-
 tests/py/any/ct.t.json.output                 |  20 +-
 tests/py/any/ct.t.payload                     |  89 ++--
 tests/py/any/meta.t.json.output               |  54 ---
 tests/py/any/meta.t.payload                   | 232 ++++-----
 tests/py/any/meta.t.payload.bridge            |  10 +-
 tests/py/any/queue.t.json.output              |   4 +-
 tests/py/any/queue.t.payload                  |   2 +-
 tests/py/any/rawpayload.t.payload             |  64 +--
 tests/py/any/rt.t.payload                     |   5 +-
 tests/py/any/tcpopt.t.json.output             |  77 ---
 tests/py/any/tcpopt.t.payload                 |  88 ++--
 tests/py/arp/arp.t.payload                    |  99 ++--
 tests/py/arp/arp.t.payload.netdev             | 189 ++++----
 tests/py/bridge/ether.t.payload               |  43 +-
 tests/py/bridge/icmpX.t.payload               |  25 +-
 tests/py/bridge/meta.t.payload                |  20 +-
 tests/py/bridge/redirect.t.payload            |   2 +-
 tests/py/bridge/reject.t.payload              |  43 +-
 tests/py/bridge/vlan.t.payload                | 262 +++++------
 tests/py/bridge/vlan.t.payload.netdev         | 316 ++++++-------
 tests/py/inet/ah.t.payload                    |  89 ++--
 tests/py/inet/comp.t.payload                  |  53 ++-
 tests/py/inet/ct.t.payload                    |  14 +-
 tests/py/inet/dccp.t.payload                  |  53 ++-
 tests/py/inet/dnat.t.payload                  |  47 +-
 tests/py/inet/esp.t.payload                   |  45 +-
 tests/py/inet/ether-ip.t.payload              |  22 +-
 tests/py/inet/ether-ip.t.payload.netdev       |  23 +-
 tests/py/inet/ether.t.payload                 |  37 +-
 tests/py/inet/ether.t.payload.bridge          |  29 +-
 tests/py/inet/ether.t.payload.ip              |  37 +-
 tests/py/inet/fib.t.payload                   |  12 +-
 tests/py/inet/geneve.t.payload                |  83 ++--
 tests/py/inet/gre.t.payload                   |  53 ++-
 tests/py/inet/gretap.t.payload                |  59 ++-
 tests/py/inet/icmp.t.payload                  |  37 +-
 tests/py/inet/icmpX.t.payload                 |  32 +-
 tests/py/inet/ip.t.payload                    |   4 +-
 tests/py/inet/ip.t.payload.bridge             |   4 +-
 tests/py/inet/ip.t.payload.inet               |   7 +-
 tests/py/inet/ip.t.payload.netdev             |   7 +-
 tests/py/inet/ip_tcp.t.payload                |  36 +-
 tests/py/inet/ip_tcp.t.payload.bridge         |  35 +-
 tests/py/inet/ip_tcp.t.payload.netdev         |  37 +-
 tests/py/inet/ipsec.t.payload                 |  11 +-
 tests/py/inet/map.t.payload                   |  11 +-
 tests/py/inet/map.t.payload.ip                |   7 +-
 tests/py/inet/map.t.payload.netdev            |  11 +-
 tests/py/inet/meta.t.payload                  |  83 ++--
 tests/py/inet/osf.t.json.output               |  54 +++
 tests/py/inet/osf.t.payload                   |  16 +-
 tests/py/inet/payloadmerge.t.payload          |  43 +-
 tests/py/inet/reject.t.payload.inet           |  43 +-
 tests/py/inet/rt.t.payload                    |   7 +-
 tests/py/inet/sctp.t.payload                  | 159 ++++---
 tests/py/inet/sets.t.payload.bridge           |  15 +-
 tests/py/inet/sets.t.payload.inet             |  14 +-
 tests/py/inet/sets.t.payload.netdev           |  14 +-
 tests/py/inet/snat.t.payload                  |  30 +-
 tests/py/inet/socket.t.payload                |   8 +-
 tests/py/inet/tcp.t.payload                   | 360 +++++++-------
 tests/py/inet/tproxy.t.payload                |  45 +-
 tests/py/inet/udp.t.payload                   | 112 ++---
 tests/py/inet/udplite.t.payload               |  81 ++--
 tests/py/inet/vmap.t.payload                  |  13 +-
 tests/py/inet/vmap.t.payload.netdev           |  13 +-
 tests/py/inet/vxlan.t.payload                 |  83 ++--
 tests/py/ip/ct.t.payload                      |  46 +-
 tests/py/ip/dnat.t.payload.ip                 | 117 +++--
 tests/py/ip/dup.t.payload                     |   7 +-
 tests/py/ip/ether.t.payload                   |  37 +-
 tests/py/ip/hash.t.payload                    |   2 +-
 tests/py/ip/icmp.t.payload.ip                 | 312 ++++++-------
 tests/py/ip/igmp.t.payload                    |  61 ++-
 tests/py/ip/ip.t.payload                      | 246 +++++-----
 tests/py/ip/ip.t.payload.bridge               | 440 +++++++++---------
 tests/py/ip/ip.t.payload.inet                 | 440 +++++++++---------
 tests/py/ip/ip.t.payload.netdev               | 434 ++++++++---------
 tests/py/ip/ip_tcp.t.payload                  |   9 +-
 tests/py/ip/masquerade.t.payload              |  71 ++-
 tests/py/ip/meta.t.payload                    |  32 +-
 tests/py/ip/numgen.t.payload                  |   4 +-
 tests/py/ip/objects.t.payload                 |  26 +-
 tests/py/ip/redirect.t.payload                | 121 +++--
 tests/py/ip/reject.t.payload                  |   3 +-
 tests/py/ip/rt.t.payload                      |   3 +-
 tests/py/ip/sets.t.payload.inet               |  38 +-
 tests/py/ip/sets.t.payload.ip                 |  12 +-
 tests/py/ip/sets.t.payload.netdev             |  38 +-
 tests/py/ip/snat.t.payload                    |  74 +--
 tests/py/ip/tcp.t.payload                     |  11 +-
 tests/py/ip/tproxy.t.payload                  |  29 +-
 tests/py/ip6/ct.t.payload                     |  12 +-
 tests/py/ip6/dnat.t.payload.ip6               |  38 +-
 tests/py/ip6/dst.t.payload.inet               |  60 +--
 tests/py/ip6/dst.t.payload.ip6                |  30 +-
 tests/py/ip6/dup.t.payload                    |   7 +-
 tests/py/ip6/ether.t.payload                  |  36 +-
 tests/py/ip6/exthdr.t.payload.ip6             |  25 +-
 tests/py/ip6/frag.t.payload.inet              | 131 +++---
 tests/py/ip6/frag.t.payload.ip6               |  75 ++-
 tests/py/ip6/frag.t.payload.netdev            | 131 +++---
 tests/py/ip6/hbh.t.payload.inet               |  65 ++-
 tests/py/ip6/hbh.t.payload.ip6                |  33 +-
 tests/py/ip6/icmpv6.t.payload.ip6             | 322 ++++++-------
 tests/py/ip6/ip6.t.payload.inet               | 359 +++++++-------
 tests/py/ip6/ip6.t.payload.ip6                | 191 ++++----
 tests/py/ip6/map.t.payload                    |   5 +-
 tests/py/ip6/masquerade.t.payload.ip6         |  71 ++-
 tests/py/ip6/meta.t.payload                   |  36 +-
 tests/py/ip6/mh.t.payload.inet                | 132 +++---
 tests/py/ip6/mh.t.payload.ip6                 |  66 +--
 tests/py/ip6/redirect.t.payload.ip6           | 105 +++--
 tests/py/ip6/reject.t.payload.ip6             |   3 +-
 tests/py/ip6/rt.t.payload.inet                | 121 +++--
 tests/py/ip6/rt.t.payload.ip6                 |  61 ++-
 tests/py/ip6/rt0.t.payload                    |   3 +-
 tests/py/ip6/sets.t.payload.inet              |  18 +-
 tests/py/ip6/sets.t.payload.ip6               |   4 +-
 tests/py/ip6/sets.t.payload.netdev            |  18 +-
 tests/py/ip6/snat.t.payload.ip6               |  23 +-
 tests/py/ip6/srh.t.payload                    |  23 +-
 tests/py/ip6/tproxy.t.payload                 |  29 +-
 tests/py/ip6/vmap.t.payload.inet              | 169 ++++---
 tests/py/ip6/vmap.t.payload.ip6               |  85 ++--
 tests/py/ip6/vmap.t.payload.netdev            | 169 ++++---
 tests/py/netdev/dup.t.payload                 |   3 +-
 tests/py/netdev/fwd.t.payload                 |   5 +-
 tests/py/netdev/reject.t.payload              |  41 +-
 tests/py/netdev/tunnel.t.payload              |   5 +-
 tests/py/tools/regen_payloads.sh              |  74 +++
 .../testcases/maps/dumps/0012map_0.json-nft   |  20 +-
 .../shell/testcases/maps/dumps/0012map_0.nft  |   8 +-
 .../maps/dumps/named_ct_objects.json-nft      |  12 +-
 .../testcases/maps/dumps/named_ct_objects.nft |   6 +-
 .../maps/dumps/typeof_integer_0.json-nft      |  12 +-
 .../testcases/maps/dumps/typeof_integer_0.nft |   4 +-
 .../dumps/0012different_defines_0.json-nft    |   8 +-
 .../nft-f/dumps/0012different_defines_0.nft   |   2 +-
 .../dumps/merge_nat_inet.json-nft             |  12 +-
 .../optimizations/dumps/merge_nat_inet.nft    |   2 +-
 .../optimizations/dumps/merge_reject.json-nft |  16 +-
 .../optimizations/dumps/merge_reject.nft      |   4 +-
 .../dumps/merge_stmts_concat.json-nft         |  42 +-
 .../dumps/merge_stmts_concat.nft              |   8 +-
 .../dumps/merge_stmts_concat_vmap.json-nft    |   4 +-
 .../dumps/merge_stmts_concat_vmap.nft         |   2 +-
 .../sets/dumps/0029named_ifname_dtype_0.nft   |   4 +-
 .../0037_set_with_inet_service_0.json-nft     |  12 +-
 .../dumps/0037_set_with_inet_service_0.nft    |   8 +-
 .../sets/dumps/sets_with_ifnames.json-nft     |   4 +-
 .../sets/dumps/sets_with_ifnames.nft          |   2 +-
 .../testcases/sets/dumps/typeof_sets_0.nft    |   4 +-
 tests/shell/testcases/sets/typeof_sets_0      |   4 +-
 163 files changed, 4743 insertions(+), 4744 deletions(-)
 create mode 100755 tests/py/tools/regen_payloads.sh
Signature · 1 line
2.51.0