Hi Martin, On Tue, Nov 17, 2026 at 07:30:22PM -0800, Martin Mirchev wrote: > Hi, > > Here are two small fixes for the net_helper converters, against current > master (f16798587). The patches are attached (git format-patch); the code > changes are independent, but 2/2 applies on top of 1/2 since it extends the > reg-test that 1/2 adds. > > 1/2 BUG/MINOR: net_helper: check the TCP option length before reading its > value > > tcp.options.mss, tcp.options.tsval and tcp.options.wscale read the value > without checking the option's length field, so a short option makes them > return the bytes that follow it. With a 24-byte header ending with "NOP NOP > 02 02" and the payload 0x12 0x34, tcp.options.mss returns 4660; with "NOP > NOP 03 02" and 0xaa, tcp.options.wscale returns 170. When nothing follows > the header, the value is read past the end of the sample. The client > chooses its SYN options, so these values come from the client. The patch > makes these converters ignore an option whose length is not the defined one > (4, 10 and 3), as if it were absent.
Ah indeed, thanks. Anyway this is harmless since such a malformed SYN wouldn't be accepted by the TCP stack but better be 100% clean here, I agree. > 2/2 BUG/MINOR: net_helper: accept an Ethernet header ending with the > protocol > > The eth.* loops use "idx + 2 < data", so an input that ends right after the > protocol field is reported as incomplete: "eth.hdr,eth.proto" and > "eth.hdr,eth.vlan" return nothing. The patch uses "<=". > > 1/2 adds reg-tests/converter/net_helper.vtc, and 2/2 extends it. The test > fails on master (mss-len2 (4660) == "0") and with only 1/2 applied > (eth-hdr-proto () == "2048"), and passes with both; the other converter > reg-tests still pass (26 passed, 6 skipped). Both should be backported to > 3.4. OK, similarly, by definition the ethernet frame that carried the SYN also contains IP and TCP headers, so these tests, just like the existing ones, are essentially cosmetic but let's do it. I'm picking both, thanks! Willy

