]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
[MEDIUM] Correct ipmask() logic
authorSimon Horman <horms@verge.net.au>
Fri, 12 Aug 2011 23:03:49 +0000 (08:03 +0900)
committerWilly Tarreau <w@1wt.eu>
Thu, 18 Aug 2011 21:52:35 +0000 (23:52 +0200)
The netmask applied to table entries as configured using ipmask() is
stored in arg_p->data.ip not arg_i (which will be 1 if the netmask is set).

src/pattern.c

index e705f00c31aa5ea225b2dbeb5cd808924c909eb2..59ff010dd129eda12eaee763714c40baed8b54c8 100644 (file)
@@ -556,7 +556,7 @@ static int pattern_conv_str2upper(const struct pattern_arg *arg_p, int arg_i, un
 /* takes the netmask in arg_i */
 static int pattern_conv_ipmask(const struct pattern_arg *arg_p, int arg_i, union pattern_data *data)
 {
-       data->ip.s_addr &= arg_i;
+       data->ip.s_addr &= arg_p->data.ip.s_addr;
        return 1;
 }