]> git.kaiwu.me - haproxy.git/commit
BUG/MINOR: net_helper: accept an Ethernet header ending with the protocol
authorMartin Mirchev <mirchevmartin2203@gmail.com>
Wed, 18 Nov 2026 03:25:34 +0000 (11:25 +0800)
committerWilly Tarreau <w@1wt.eu>
Fri, 20 Nov 2026 11:36:57 +0000 (12:36 +0100)
commitd9807b77dd8b5ee6eb092bf4a33e09c2ab4c4752
tree861fa2e9fcd6ff1f7a217de6b16ed5ef85429b4b
parent493ad9d11104a7c3650cf434ac8dffa7cf5177c8
BUG/MINOR: net_helper: accept an Ethernet header ending with the protocol

The eth.data, eth.hdr, eth.proto and eth.vlan converters walk the
Ethernet header with "idx + 2 < data", which requires at least one byte
after the 2-byte protocol field. An input that ends exactly with the
header is thus reported as incomplete, so eth.proto and eth.vlan return
nothing on the output of eth.hdr: "eth.hdr,eth.proto" never works, and
neither does any frame truncated right after the protocol field.

The protocol field is complete when idx + 2 <= data, so let's use this
condition in the 4 loops. Frames that carry data after the header are
not affected. The net_helper reg-test now checks eth.hdr followed by
eth.proto and eth.vlan.

This should be backported to 3.4.
reg-tests/converter/net_helper.vtc
src/net_helper.c