From d281eedc07d43b9d1b199aa4b8d6260a204f001e Mon Sep 17 00:00:00 2001 From: Simon Horman Date: Sat, 13 Aug 2011 08:03:49 +0900 Subject: [PATCH] [MEDIUM] Correct ipmask() logic 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 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pattern.c b/src/pattern.c index e705f00c31..59ff010dd1 100644 --- a/src/pattern.c +++ b/src/pattern.c @@ -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; } -- 2.47.3