]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: tools: Impprove hash_ipanon to support dgram sockets and port offsets
authorChristopher Faulet <cfaulet@haproxy.com>
Thu, 29 Sep 2022 09:46:34 +0000 (11:46 +0200)
committerChristopher Faulet <cfaulet@haproxy.com>
Thu, 29 Sep 2022 09:46:35 +0000 (11:46 +0200)
Add PA_O_DGRAM and PA_O_PORT_OFS options when str2sa_range() is called. This
way dgram sockets and addresses with port offsets are supported.

No backport needed, except if anonymization mechanism is backported.

src/tools.c

index 53958a996a01f7af1e2d8fb5d1ba5084d09e8d2d..5185204b13861e87710d263882545cd9e271c43e 100644 (file)
@@ -5908,8 +5908,8 @@ const char *hash_ipanon(uint32_t scramble, char *ipstring, int hasport)
                }
                else {
                        sa = str2sa_range(ipstring, NULL, NULL, NULL, NULL, NULL, &errmsg, NULL, NULL,
-                                         PA_O_PORT_OK | PA_O_STREAM | PA_O_XPRT | PA_O_CONNECT |
-                                         PA_O_PORT_RANGE | PA_O_RESOLVE);
+                                         PA_O_PORT_OK | PA_O_STREAM | PA_O_DGRAM | PA_O_XPRT | PA_O_CONNECT |
+                                         PA_O_PORT_RANGE | PA_O_PORT_OFS | PA_O_RESOLVE);
                        if (sa == NULL) {
                                return HA_ANON_STR(scramble, ipstring);
                        }