Skip to content

nftables: fix some endian issues

Patrick McHardy netfilter-devel 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest3 patches 1 replyIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3payload: take endianess into account when updating the payload contextsrc/payload.c+8 -10 replies
2/3datatype: take endianess into account in symbolic_constant_print()src/datatype.c+7 -10 replies
3/3proto: fix byteorder of ETH_P_* valuessrc/proto.c+12 -120 replies

Reviews trailers per patch

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

Read the v1 thread

Cover letter [PATCH 0/3] nftables: fix some endian issues

These patches fix the endian issues Alvaro observed in the bridge table.

The main problem was that the ETH_P_* values are in host byte order, so they never matches. This is fixed by simply converting the constants to big endian.

Two related problems are that symbol table printing and higher layer protocol lookup didn't take endianess into account properly. This is fixes by exporting the value in the proper byte order before comparison.

With these patches, everything works as expected:

table bridge filter {
	chain input {
		 type filter hook input priority -200;
		 ip daddr 192.168.1.80 tcp dport ssh counter packets 0 bytes 0
		 ether type ip counter packets 128 bytes 36734
		 ether type arp counter packets 12 bytes 336
	}
}