]> git.ipfire.org Git - thirdparty/haproxy.git/commit
BUG/MINOR: stick-table/cli: Check for invalid ipv4 key
authorAurelien DARRAGON <adarragon@haproxy.com>
Mon, 28 Aug 2023 11:57:19 +0000 (13:57 +0200)
committerChristopher Faulet <cfaulet@haproxy.com>
Wed, 8 Nov 2023 15:38:06 +0000 (16:38 +0100)
commitc6826b957053e47932ed0560a9a562d707f7dedf
tree6b33d9aca189c9aacaf8ca676102dec7269799d1
parentba6ad4654e5bb86af79c87c69cac3804c5364b33
BUG/MINOR: stick-table/cli: Check for invalid ipv4 key

When an ipv4 key is used to filter a CLI command on a stick table
clear/set/show table ...), inetaddr_host+htonl combination was used
with no error checking.

Instead, we now use inet_pton(), which is what we use for ipv6 addresses
since b7c962b0c0 ("BUG/MINOR: stick-table/cli: Check for invalid ipv6 key")

Doing this allows us to easily check for parsing errors: we're trading off
some parsing efficience to better catch input errors and ensure we get
similar behavior between ipv4 and ipv6 addresses handling.

This patch may be backported to all supported versions.
src/stick_table.c