iprange_parse() was incomplete and did not include parsed ranges into
ipt_iprange_info structure resulting in always adding range
0.0.0.0-0.0.0.0 in the kernel.
Moreover, when using --dst-range, error messages may display
--src-range instead. Fix this too.
Signed-off-by: Vincent Bernat <bernat@luffy.cx>
Signed-off-by: Patrick McHardy <kaber@trash.net>
if (invert)
info->flags |= IPRANGE_SRC_INV;
iprange_parse_range(optarg, range, NFPROTO_IPV4, "--src-range");
-
+ info->src.min_ip = range[0].ip;
+ info->src.max_ip = range[1].ip;
break;
case '2':
if (invert)
info->flags |= IPRANGE_DST_INV;
- iprange_parse_range(optarg, range, NFPROTO_IPV4, "--src-range");
-
+ iprange_parse_range(optarg, range, NFPROTO_IPV4, "--dst-range");
+ info->dst.min_ip = range[0].ip;
+ info->dst.max_ip = range[1].ip;
break;
default: