From: Willy Tarreau Date: Thu, 1 Jan 2026 09:15:54 +0000 (+0100) Subject: MINOR: net_helper: prepare the ip.fp() converter to support more options X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2c317cfed752c4e0cffccf9f1a3fa42da834e9d0;p=thirdparty%2Fhaproxy.git MINOR: net_helper: prepare the ip.fp() converter to support more options It can make sense to support extra components in the fingerprint to ease configuration, so let's change the 0/1 value to a bit field. We also turn the current 1 (TCP options list) to 2 so that we'll reuse 1 for the TTL. --- diff --git a/doc/configuration.txt b/doc/configuration.txt index 7f88178fa..0f865d8d6 100644 --- a/doc/configuration.txt +++ b/doc/configuration.txt @@ -21137,10 +21137,14 @@ ip.fp([]) - byte 3..4: tcp.win - byte 5..6: tcp.options.mss, or zero if absent - When the argument is not set or is zero, the fingerprint is solely - made of the 7 bytes described above. When the is 1, it starts by the - 7-byte block above, and is followed by the list of TCP option kinds, for 0 - to 40 extra bytes, as returned by "tcp.options_list". + The argument permits to append more information to the fingerprint. By + default, when the argument is not set or is zero, the fingerprint is + solely made of the 7 bytes described above. If is specified as another + value, it then corresponds to the sum of the following values, and the + respective components will be concatenated to the fingerprint, in the order + below: + - 2: the list of TCP option kinds, as returned by "tcp.options_list", + made of 0 to 40 extra bytes, is appended to the fingerprint Example: diff --git a/src/net_helper.c b/src/net_helper.c index a3181fbe3..4a187b375 100644 --- a/src/net_helper.c +++ b/src/net_helper.c @@ -776,7 +776,7 @@ static int sample_conv_ip_fp(const struct arg *arg_p, struct sample *smp, void * break; /* option is complete, take a copy of it */ - if (mode > 0) + if (mode & 2) // mode & 2: append tcp.options_list trash->area[trash->data++] = smp->data.u.str.area[ofs]; if (smp->data.u.str.area[ofs] == 2 /* MSS */) {