summaryrefslogtreecommitdiffstats
path: root/ipset_ipportnethash.c
diff options
context:
space:
mode:
author/C=EU/ST=EU/CN=Jozsef Kadlecsik/emailAddress=kadlec@blackhole.kfki.hu </C=EU/ST=EU/CN=Jozsef Kadlecsik/emailAddress=kadlec@blackhole.kfki.hu>2008-11-13 09:36:37 +0000
committer/C=EU/ST=EU/CN=Jozsef Kadlecsik/emailAddress=kadlec@blackhole.kfki.hu </C=EU/ST=EU/CN=Jozsef Kadlecsik/emailAddress=kadlec@blackhole.kfki.hu>2008-11-13 09:36:37 +0000
commit4eec8b3824d49c1c0503ebbf7844a4e312bc29e1 (patch)
tree9b67c7a33f683e5a607517dc3ca5a0ddaefeb449 /ipset_ipportnethash.c
parentb3259c8f91a689e01469b4eca8ada7924011be25 (diff)
2.4.4
- Premature checking prevents to add valid elements to hash types, fixed (bug reported by JC Janos). - Local variable shadows another variable, fixed (reported by Jan Engelhardt). - More compiler warning options added and warnings fixed.
Diffstat (limited to 'ipset_ipportnethash.c')
-rw-r--r--ipset_ipportnethash.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/ipset_ipportnethash.c b/ipset_ipportnethash.c
index 83a83fe..eabe41e 100644
--- a/ipset_ipportnethash.c
+++ b/ipset_ipportnethash.c
@@ -46,7 +46,7 @@ create_init(void *data)
/* Function which parses command options; returns true if it ate an option */
static int
-create_parse(int c, char *argv[], void *data, unsigned *flags)
+create_parse(int c, char *argv[] UNUSED, void *data, unsigned *flags)
{
struct ip_set_req_ipportnethash_create *mydata = data;
ip_set_ip_t value;
@@ -184,19 +184,19 @@ static const struct option create_opts[] = {
{.name = "from", .has_arg = required_argument, .val = '4'},
{.name = "to", .has_arg = required_argument, .val = '5'},
{.name = "network", .has_arg = required_argument, .val = '6'},
- {NULL},
+ {0, 0, 0, 0},
};
/* Add, del, test parser */
static ip_set_ip_t
-adt_parser(unsigned cmd, const char *optarg, void *data)
+adt_parser(int cmd, const char *arg, void *data)
{
struct ip_set_req_ipportnethash *mydata = data;
- char *saved = ipset_strdup(optarg);
+ char *saved = ipset_strdup(arg);
char *ptr, *tmp = saved;
ip_set_ip_t cidr;
- DP("ipportnethash: %p %p", optarg, data);
+ DP("ipportnethash: %p %p", arg, data);
if (((ptr = strchr(tmp, ':')) || (ptr = strchr(tmp, '%'))) && ++warn_once == 1)
fprintf(stderr, "Warning: please use ',' separator token between ip,port,net.\n"
@@ -220,11 +220,11 @@ adt_parser(unsigned cmd, const char *optarg, void *data)
cidr = 32;
else
exit_error(PARAMETER_PROBLEM,
- "Missing /cidr from `%s'", optarg);
+ "Missing /cidr from `%s'", arg);
else
if (string_to_number(tmp, 1, 31, &cidr))
exit_error(PARAMETER_PROBLEM,
- "Out of range cidr `%s' specified", optarg);
+ "Out of range cidr `%s' specified", arg);
mydata->cidr = cidr;
@@ -266,7 +266,7 @@ printheader(struct set *set, unsigned options)
static char buf[20];
static char *
-unpack_ip_tostring(ip_set_ip_t ip, unsigned options)
+unpack_ip_tostring(ip_set_ip_t ip, unsigned options UNUSED)
{
int i, j = 3;
unsigned char a, b;
@@ -313,7 +313,7 @@ unpack_ip_tostring(ip_set_ip_t ip, unsigned options)
((unsigned char *)&ip)[3],
b);
- DP("%s %s", ip_tostring(ntohl(ip), options), buf);
+ DP("%s %s", ip_tostring(ntohl(ip), 0), buf);
return buf;
}
@@ -419,7 +419,7 @@ static struct settype settype_ipportnethash = {
.usage = &usage,
};
-void _init(void)
+CONSTRUCTOR(ipportnethash)
{
settype_register(&settype_ipportnethash);