summaryrefslogtreecommitdiffstats
path: root/ipset_portmap.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_portmap.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_portmap.c')
-rw-r--r--ipset_portmap.c21
1 files changed, 12 insertions, 9 deletions
diff --git a/ipset_portmap.c b/ipset_portmap.c
index 6d35b4c..b9f4ef8 100644
--- a/ipset_portmap.c
+++ b/ipset_portmap.c
@@ -32,7 +32,7 @@
/* Initialize the create. */
static void
-create_init(void *data)
+create_init(void *data UNUSED)
{
DP("create INIT");
/* Nothing */
@@ -40,7 +40,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_portmap_create *mydata = data;
@@ -108,16 +108,16 @@ create_final(void *data, unsigned int flags)
static const struct option create_opts[] = {
{.name = "from", .has_arg = required_argument, .val = '1'},
{.name = "to", .has_arg = required_argument, .val = '2'},
- {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 UNUSED, const char *arg, void *data)
{
struct ip_set_req_portmap *mydata = data;
- parse_port(optarg, &mydata->ip);
+ parse_port(arg, &mydata->ip);
DP("%s", port_tostring(mydata->ip, 0));
return 1;
@@ -148,7 +148,8 @@ printheader(struct set *set, unsigned options)
}
static void
-printports_sorted(struct set *set, void *data, size_t len, unsigned options)
+printports_sorted(struct set *set, void *data,
+ size_t len UNUSED, unsigned options)
{
struct ip_set_portmap *mysetdata = set->settype->header;
u_int32_t addr = mysetdata->first_ip;
@@ -162,7 +163,8 @@ printports_sorted(struct set *set, void *data, size_t len, unsigned options)
}
static char *
-binding_port_tostring(struct set *set, ip_set_ip_t ip, unsigned options)
+binding_port_tostring(struct set *set UNUSED,
+ ip_set_ip_t ip, unsigned options)
{
return port_tostring(ip, options);
}
@@ -181,7 +183,8 @@ saveheader(struct set *set, unsigned options)
}
static void
-saveports(struct set *set, void *data, size_t len, unsigned options)
+saveports(struct set *set, void *data,
+ size_t len UNUSED, unsigned options)
{
struct ip_set_portmap *mysetdata = set->settype->header;
u_int32_t addr = mysetdata->first_ip;
@@ -235,7 +238,7 @@ static struct settype settype_portmap = {
.usage = &usage,
};
-void _init(void)
+CONSTRUCTOR(portmap)
{
settype_register(&settype_portmap);