From acb7d8a89cb16836b5764607a13fd1759427ae7e Mon Sep 17 00:00:00 2001 From: Aurelien DARRAGON Date: Tue, 5 Sep 2023 16:07:49 +0200 Subject: [PATCH] MINOR: pattern: fix pat_{parse,match}_ip() function comments Function comments were outdated, probably because they have not been updated during the previous refactors. Fixing comments to better reflect the current behavior. This may be backported up to 2.2, or even 2.0 by slightly adapting the patch (in 2.0, such functions are documented in proto/pattern.h) --- include/haproxy/pattern.h | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/include/haproxy/pattern.h b/include/haproxy/pattern.h index ab56711af..49e5ad2c2 100644 --- a/include/haproxy/pattern.h +++ b/include/haproxy/pattern.h @@ -122,9 +122,10 @@ int pat_parse_bin(const char *text, struct pattern *pattern, int mflags, char ** int pat_parse_reg(const char *text, struct pattern *pattern, int mflags, char **err); /* Parse an IP address and an optional mask in the form addr[/mask]. - * The addr may either be an IPv4 address or a hostname. The mask - * may either be a dotted mask or a number of bits. Returns 1 if OK, - * otherwise 0. + * The addr may either be an IPv4 or IPv6 address, or a hostname that resolves + * to a valid IPv4 address. The mask can be provided as a number of bits, or + * even as a dotted mask (but the latter only works for IPv4 addresses). + * Returns 1 if OK, otherwise 0. */ int pat_parse_ip(const char *text, struct pattern *pattern, int mflags, char **err); @@ -164,7 +165,9 @@ struct pattern *pat_match_dir(struct sample *smp, struct pattern_expr *expr, int */ struct pattern *pat_match_dom(struct sample *smp, struct pattern_expr *expr, int fill); -/* Check that the IPv4 address in matches the IP/mask in pattern */ +/* Check that the input IP address (IPv4 or IPv6) in matches the IP/mask + * in pattern + */ struct pattern *pat_match_ip(struct sample *smp, struct pattern_expr *expr, int fill); /* Executes a regex. It temporarily changes the data to add a trailing zero,