]> git.ipfire.org Git - thirdparty/iptables.git/commit
extensions: libebt_ip: Translation has to match on ether type
authorPhil Sutter <phil@nwl.cc>
Fri, 3 Feb 2023 16:37:40 +0000 (17:37 +0100)
committerPhil Sutter <phil@nwl.cc>
Fri, 17 Feb 2023 17:18:48 +0000 (18:18 +0100)
commitb860e658200af8fdeced2896a1a6c2f0f0692b70
tree146f8d8c9cf7c5c57afe827ab6b8214e9e161b8b
parent744c56bda974caaa274318d2825b3e43b55bf145
extensions: libebt_ip: Translation has to match on ether type

On one hand, nft refuses th expression in bridge family if layer3
protocol has not been assured by a previous match. On the other, ebt_ip
kernel module will only match on IPv4 packets, so there might be a
functional change in the translation versus the original.

Instead of just always emitting an 'ether type' match, decide whether
it's actually needed - explicit "ip <something>" payload matches (or
icmp ones) cause implicit creation of a match on IPv4 by nft.

Fixes: 03ecffe6c2cc0 ("ebtables-compat: add initial translations")
Signed-off-by: Phil Sutter <phil@nwl.cc>
extensions/libebt_ip.c
extensions/libebt_ip.txlate