From b46731dfbb13a88984f1e9fbab3dc072d2e3bacb Mon Sep 17 00:00:00 2001 From: "/C=DE/ST=Berlin/L=Berlin/O=Netfilter Project/OU=Development/CN=kadlec/emailAddress=kadlec@netfilter.org" Date: Tue, 19 Apr 2005 07:29:07 +0000 Subject: new feature added: IP addresses in nethash type of sets can be tested --- ipset_nethash.c | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) (limited to 'ipset_nethash.c') diff --git a/ipset_nethash.c b/ipset_nethash.c index 34a7152..0934571 100644 --- a/ipset_nethash.c +++ b/ipset_nethash.c @@ -136,13 +136,16 @@ ip_set_ip_t adt_parser(unsigned cmd, const char *optarg, void *data) ptr = strsep(&tmp, "/"); - if (tmp == NULL) - exit_error(PARAMETER_PROBLEM, - "Missing cidr from `%s'", optarg); - - if (string_to_number(tmp, 1, 31, &cidr)) - exit_error(PARAMETER_PROBLEM, - "Out of range cidr `%s' specified", optarg); + if (tmp == NULL) { + if (cmd == CMD_TEST) + cidr = 32; + else + exit_error(PARAMETER_PROBLEM, + "Missing cidr from `%s'", optarg); + } else + if (string_to_number(tmp, 1, 31, &cidr)) + exit_error(PARAMETER_PROBLEM, + "Out of range cidr `%s' specified", optarg); mydata->cidr = cidr; parse_ip(ptr, &mydata->ip); -- cgit v1.2.3