From 894ebbc905ea760bab182513a74dc8bf3c2952cd Mon Sep 17 00:00:00 2001 From: "/C=EU/ST=EU/CN=Jozsef Kadlecsik/emailAddress=kadlec@blackhole.kfki.hu" Date: Sat, 25 Oct 2008 12:50:34 +0000 Subject: 2.4.3 - Include file was missing from userspace set type modules. --- ChangeLog | 4 +++ Makefile | 2 +- ipset.c | 40 ++++++++++++---------- ipset.h | 6 ++-- ipset_iphash.c | 11 +++--- ipset_ipmap.c | 8 ++--- ipset_ipporthash.c | 13 ++++--- ipset_ipportiphash.c | 13 ++++--- ipset_ipportnethash.c | 13 ++++--- ipset_iptree.c | 12 +++---- ipset_iptreemap.c | 13 ++++--- ipset_macipmap.c | 12 +++---- ipset_nethash.c | 17 +++++---- ipset_portmap.c | 7 ++-- .../include/linux/netfilter_ipv4/ip_set_hashes.h | 2 ++ 15 files changed, 88 insertions(+), 85 deletions(-) diff --git a/ChangeLog b/ChangeLog index 278a4a0..613b09e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2.4.3 + - Include file was missing from userspace set type + modules. + 2.4.2 - Only kernel part changes, see kernel/ChangeLoh diff --git a/Makefile b/Makefile index 37a241e..7dfd819 100644 --- a/Makefile +++ b/Makefile @@ -20,7 +20,7 @@ ifndef V V=0 endif -IPSET_VERSION:=2.4.2 +IPSET_VERSION:=2.4.3 PREFIX:=/usr/local LIBDIR:=$(PREFIX)/lib diff --git a/ipset.c b/ipset.c index 4b7d5f9..8b906aa 100644 --- a/ipset.c +++ b/ipset.c @@ -7,19 +7,22 @@ * published by the Free Software Foundation. */ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include /* *printf, perror, sscanf, fdopen */ +#include /* mem*, str* */ +#include /* errno, perror */ +#include /* time, ctime */ +#include /* gethostby*, getnetby*, getservby* */ +#include /* exit, malloc, free, strtol, getenv, mkstemp */ +#include /* read, close, fork, exec*, unlink */ +#include /* open, wait, socket, *sockopt, umask */ +#include /* open, umask */ +#include /* wait */ +#include /* socket, *sockopt, gethostby*, inet_* */ +#include /* inet_* */ +#include /* open */ +#include /* htonl, inet_* */ +#include /* va_* */ +#include /* dlopen */ #include "ipset.h" @@ -510,13 +513,12 @@ char *ipset_strdup(const char *s) return p; } -void ipset_free(void **data) +void ipset_free(void *data) { - if (*data == NULL) + if (data == NULL) return; - free(*data); - *data = NULL; + free(data); } static struct option *merge_options(struct option *oldopts, @@ -1265,7 +1267,7 @@ static int try_save_sets(const char name[IP_SET_MAXNAMELEN]) printf("COMMIT\n"); now = time(NULL); printf("# Completed on %s", ctime(&now)); - ipset_free(&data); + ipset_free(data); return res; } @@ -1847,7 +1849,7 @@ static int try_list_sets(const char name[IP_SET_MAXNAMELEN], while (size != req_size) size += print_set(data + size, options); - ipset_free(&data); + ipset_free(data); return res; } diff --git a/ipset.h b/ipset.h index 12091ba..1c8b0c1 100644 --- a/ipset.h +++ b/ipset.h @@ -20,7 +20,9 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include +#include /* struct option */ +#include +#include #include @@ -180,7 +182,7 @@ extern int string_to_number(const char *str, unsigned int min, unsigned int max, extern void *ipset_malloc(size_t size); extern char *ipset_strdup(const char *); -extern void ipset_free(void **data); +extern void ipset_free(void *data); extern struct set *set_find_byname(const char *name); extern struct set *set_find_byid(ip_set_id_t id); diff --git a/ipset_iphash.c b/ipset_iphash.c index 9f02081..8110203 100644 --- a/ipset_iphash.c +++ b/ipset_iphash.c @@ -15,15 +15,14 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include -#include -#include -#include - -#include +#include /* UINT_MAX */ +#include /* *printf */ +#include /* mem* */ #include "ipset.h" +#include + #define BUFLEN 30; #define OPT_CREATE_HASHSIZE 0x01U diff --git a/ipset_ipmap.c b/ipset_ipmap.c index f1586bb..f068537 100644 --- a/ipset_ipmap.c +++ b/ipset_ipmap.c @@ -17,13 +17,13 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include -#include -#include +#include /* *printf */ +#include /* mem* */ -#include #include "ipset.h" +#include + #define BUFLEN 30; #define OPT_CREATE_FROM 0x01U diff --git a/ipset_ipporthash.c b/ipset_ipporthash.c index a839bd5..be8cd85 100644 --- a/ipset_ipporthash.c +++ b/ipset_ipporthash.c @@ -15,15 +15,14 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include -#include -#include -#include - -#include +#include /* UINT_MAX */ +#include /* *printf */ +#include /* mem*, str* */ #include "ipset.h" +#include + #define OPT_CREATE_HASHSIZE 0x01U #define OPT_CREATE_PROBES 0x02U #define OPT_CREATE_RESIZE 0x04U @@ -210,7 +209,7 @@ adt_parser(unsigned cmd, const char *optarg, void *data) else exit_error(PARAMETER_PROBLEM, "IP address and port must be specified: ip,port"); - free(saved); + ipset_free(saved); return 1; }; diff --git a/ipset_ipportiphash.c b/ipset_ipportiphash.c index 5cb920d..84d085f 100644 --- a/ipset_ipportiphash.c +++ b/ipset_ipportiphash.c @@ -15,15 +15,14 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include -#include -#include -#include - -#include +#include /* UINT_MAX */ +#include /* *printf */ +#include /* mem*, str* */ #include "ipset.h" +#include + #define OPT_CREATE_HASHSIZE 0x01U #define OPT_CREATE_PROBES 0x02U #define OPT_CREATE_RESIZE 0x04U @@ -216,7 +215,7 @@ adt_parser(unsigned cmd, const char *optarg, void *data) else exit_error(PARAMETER_PROBLEM, "IP address, port and IP address must be specified: ip,port,ip"); - free(saved); + ipset_free(saved); return 1; }; diff --git a/ipset_ipportnethash.c b/ipset_ipportnethash.c index 4707189..83a83fe 100644 --- a/ipset_ipportnethash.c +++ b/ipset_ipportnethash.c @@ -15,15 +15,14 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include -#include -#include -#include - -#include +#include /* UINT_MAX */ +#include /* *printf */ +#include /* mem*, str* */ #include "ipset.h" +#include + #define OPT_CREATE_HASHSIZE 0x01U #define OPT_CREATE_PROBES 0x02U #define OPT_CREATE_RESIZE 0x04U @@ -230,7 +229,7 @@ adt_parser(unsigned cmd, const char *optarg, void *data) mydata->cidr = cidr; parse_ip(ptr, &mydata->ip1); - free(saved); + ipset_free(saved); return 1; }; diff --git a/ipset_iptree.c b/ipset_iptree.c index f77da19..b127c9f 100644 --- a/ipset_iptree.c +++ b/ipset_iptree.c @@ -15,14 +15,14 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include -#include -#include -#include +#include /* UINT_MAX */ +#include /* *printf */ +#include /* mem* */ -#include #include "ipset.h" +#include + #define BUFLEN 30; #define OPT_CREATE_TIMEOUT 0x01U @@ -95,7 +95,7 @@ adt_parser(unsigned cmd, const char *optarg, void *data) else mydata->timeout = 0; - free(saved); + ipset_free(saved); return 1; } diff --git a/ipset_iptreemap.c b/ipset_iptreemap.c index 72af5b8..d1d31bb 100644 --- a/ipset_iptreemap.c +++ b/ipset_iptreemap.c @@ -15,15 +15,14 @@ * Place, Suite 330, Boston, MA 02111-1307 USA */ -#include -#include -#include -#include - -#include +#include /* UINT_MAX */ +#include /* *printf */ +#include /* mem* */ #include "ipset.h" +#include + #define OPT_CREATE_GC 0x1 static void @@ -89,7 +88,7 @@ adt_parser(unsigned int cmd, const char *optarg, void *data) } } - free(saved); + ipset_free(saved); return 1; } diff --git a/ipset_macipmap.c b/ipset_macipmap.c index 3a9530c..d4b8a06 100644 --- a/ipset_macipmap.c +++ b/ipset_macipmap.c @@ -18,15 +18,15 @@ */ -#include -#include -#include -#include -#include +#include /* *printf */ +#include /* mem* */ +#include /* str* */ +#include /* ETH_ALEN */ -#include #include "ipset.h" +#include + #define BUFLEN 30; #define OPT_CREATE_FROM 0x01U diff --git a/ipset_nethash.c b/ipset_nethash.c index 3d2e6fe..ff6576f 100644 --- a/ipset_nethash.c +++ b/ipset_nethash.c @@ -15,15 +15,14 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include -#include -#include -#include - -#include +#include /* UINT_MAX */ +#include /* *printf */ +#include /* mem*, str* */ #include "ipset.h" +#include + #define BUFLEN 30; #define OPT_CREATE_HASHSIZE 0x01U @@ -143,7 +142,7 @@ adt_parser(unsigned cmd, const char *optarg, void *data) if (!mydata->ip) exit_error(PARAMETER_PROBLEM, "Zero valued IP address `%s' specified", ptr); - free(saved); + ipset_free(saved); return mydata->ip; }; @@ -277,7 +276,7 @@ net_tostring(struct set *set, ip_set_ip_t ip, unsigned options) static void parse_net(const char *str, ip_set_ip_t *ip) { - char *saved = strdup(str); + char *saved = ipset_strdup(str); char *ptr, *tmp = saved; ip_set_ip_t cidr; @@ -292,7 +291,7 @@ parse_net(const char *str, ip_set_ip_t *ip) "Out of range cidr `%s' specified", str); parse_ip(ptr, ip); - free(saved); + ipset_free(saved); *ip = pack_ip_cidr(*ip, cidr); } diff --git a/ipset_portmap.c b/ipset_portmap.c index d13cdb1..6d35b4c 100644 --- a/ipset_portmap.c +++ b/ipset_portmap.c @@ -16,13 +16,12 @@ */ -#include -#include -#include +#include /* *printf */ +#include /* mem* */ -#include #include "ipset.h" +#include #define BUFLEN 30; diff --git a/kernel/include/linux/netfilter_ipv4/ip_set_hashes.h b/kernel/include/linux/netfilter_ipv4/ip_set_hashes.h index 46512b4..6914a12 100644 --- a/kernel/include/linux/netfilter_ipv4/ip_set_hashes.h +++ b/kernel/include/linux/netfilter_ipv4/ip_set_hashes.h @@ -267,6 +267,8 @@ del_cidr_size(uint8_t *cidr, uint8_t size) } cidr[29] = 0; } +#else +#include #endif /* __KERNEL */ #ifndef UINT16_MAX -- cgit v1.2.3