]> git.ipfire.org Git - thirdparty/iptables.git/commit
ebtables: Fix among match
authorPhil Sutter <phil@nwl.cc>
Thu, 4 Aug 2022 15:01:26 +0000 (17:01 +0200)
committerPhil Sutter <phil@nwl.cc>
Wed, 28 Sep 2022 17:21:16 +0000 (19:21 +0200)
commiteddbb27651b93ac6f329bf8113223e7360ea7613
treec408ed4144ecd52b77d85cd17166bae77bfeb4b0
parentaa0b8b03f7c7e741ccd96360bd64d90ea8c3c3aa
ebtables: Fix among match

Fixed commit broke among match in two ways:

1) The two lookup sizes are 12 and 6, not 12 and 4 - among supports
   either ether+IP or ether only, not IP only.

2) Adding two to sreg_count to get the second register is too simple: It
   works only for four byte regs, not the 16 byte ones. The first
   register is always a 16 byte one, though.

Fixing (1) is trivial, fix (2) by introduction of nft_get_next_reg()
doing the right thing. For consistency, use it for among match creation,
too.

Fixes: f315af1cf8871 ("nft: track each register individually")
Signed-off-by: Phil Sutter <phil@nwl.cc>
iptables/nft-bridge.c
iptables/nft-shared.c
iptables/nft-shared.h
iptables/nft.c