mirror of
git://git.code.sf.net/p/xtables-addons/xtables-addons
synced 2025-09-21 12:04:56 +02:00
ipset: upgrade to ipset 2.4.4
This commit is contained in:
@@ -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_ipporthash_create *mydata = data;
|
||||
ip_set_ip_t value;
|
||||
@@ -184,18 +184,18 @@ 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 UNUSED, const char *arg, void *data)
|
||||
{
|
||||
struct ip_set_req_ipporthash *mydata = data;
|
||||
char *saved = ipset_strdup(optarg);
|
||||
char *saved = ipset_strdup(arg);
|
||||
char *ptr, *tmp = saved;
|
||||
|
||||
DP("ipporthash: %p %p", optarg, data);
|
||||
DP("ipporthash: %p %p", arg, data);
|
||||
|
||||
if (((ptr = strchr(tmp, ':')) || (ptr = strchr(tmp, '%'))) && ++warn_once == 1)
|
||||
fprintf(stderr, "Warning: please use ',' separator token between ip,port.\n"
|
||||
@@ -209,6 +209,10 @@ adt_parser(unsigned cmd, const char *optarg, void *data)
|
||||
else
|
||||
exit_error(PARAMETER_PROBLEM,
|
||||
"IP address and port must be specified: ip,port");
|
||||
|
||||
if (!(mydata->ip || mydata->port))
|
||||
exit_error(PARAMETER_PROBLEM,
|
||||
"Zero valued IP address and port `%s' specified", arg);
|
||||
ipset_free(saved);
|
||||
return 1;
|
||||
};
|
||||
@@ -359,7 +363,7 @@ static struct settype settype_ipporthash = {
|
||||
.usage = &usage,
|
||||
};
|
||||
|
||||
static __attribute__((constructor)) void ipporthash_init(void)
|
||||
CONSTRUCTOR(ipporthash)
|
||||
{
|
||||
settype_register(&settype_ipporthash);
|
||||
|
||||
|
Reference in New Issue
Block a user