+2.4.3
+ - Include file <limits.h> was missing from userspace set type
+ modules.
+
2.4.2
- Only kernel part changes, see kernel/ChangeLoh
V=0
endif
-IPSET_VERSION:=2.4.2
+IPSET_VERSION:=2.4.3
PREFIX:=/usr/local
LIBDIR:=$(PREFIX)/lib
* published by the Free Software Foundation.
*/
-#include <stdio.h>
-#include <string.h>
-#include <errno.h>
-#include <time.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <sys/stat.h>
-#include <sys/wait.h>
-#include <arpa/inet.h>
-#include <stdarg.h>
-#include <netdb.h>
-#include <dlfcn.h>
-#include <fcntl.h>
+#include <stdio.h> /* *printf, perror, sscanf, fdopen */
+#include <string.h> /* mem*, str* */
+#include <errno.h> /* errno, perror */
+#include <time.h> /* time, ctime */
+#include <netdb.h> /* gethostby*, getnetby*, getservby* */
+#include <stdlib.h> /* exit, malloc, free, strtol, getenv, mkstemp */
+#include <unistd.h> /* read, close, fork, exec*, unlink */
+#include <sys/types.h> /* open, wait, socket, *sockopt, umask */
+#include <sys/stat.h> /* open, umask */
+#include <sys/wait.h> /* wait */
+#include <sys/socket.h> /* socket, *sockopt, gethostby*, inet_* */
+#include <netinet/in.h> /* inet_* */
+#include <fcntl.h> /* open */
+#include <arpa/inet.h> /* htonl, inet_* */
+#include <stdarg.h> /* va_* */
+#include <dlfcn.h> /* dlopen */
#include "ipset.h"
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,
printf("COMMIT\n");
now = time(NULL);
printf("# Completed on %s", ctime(&now));
- ipset_free(&data);
+ ipset_free(data);
return res;
}
while (size != req_size)
size += print_set(data + size, options);
- ipset_free(&data);
+ ipset_free(data);
return res;
}
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
-#include <getopt.h>
+#include <getopt.h> /* struct option */
+#include <stdint.h>
+#include <sys/types.h>
#include <linux/netfilter_ipv4/ip_set.h>
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);
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <arpa/inet.h>
-
-#include <linux/netfilter_ipv4/ip_set_iphash.h>
+#include <limits.h> /* UINT_MAX */
+#include <stdio.h> /* *printf */
+#include <string.h> /* mem* */
#include "ipset.h"
+#include <linux/netfilter_ipv4/ip_set_iphash.h>
+
#define BUFLEN 30;
#define OPT_CREATE_HASHSIZE 0x01U
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
-#include <stdio.h>
-#include <string.h>
-#include <arpa/inet.h>
+#include <stdio.h> /* *printf */
+#include <string.h> /* mem* */
-#include <linux/netfilter_ipv4/ip_set_ipmap.h>
#include "ipset.h"
+#include <linux/netfilter_ipv4/ip_set_ipmap.h>
+
#define BUFLEN 30;
#define OPT_CREATE_FROM 0x01U
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <arpa/inet.h>
-
-#include <linux/netfilter_ipv4/ip_set_ipporthash.h>
+#include <limits.h> /* UINT_MAX */
+#include <stdio.h> /* *printf */
+#include <string.h> /* mem*, str* */
#include "ipset.h"
+#include <linux/netfilter_ipv4/ip_set_ipporthash.h>
+
#define OPT_CREATE_HASHSIZE 0x01U
#define OPT_CREATE_PROBES 0x02U
#define OPT_CREATE_RESIZE 0x04U
else
exit_error(PARAMETER_PROBLEM,
"IP address and port must be specified: ip,port");
- free(saved);
+ ipset_free(saved);
return 1;
};
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <arpa/inet.h>
-
-#include <linux/netfilter_ipv4/ip_set_ipportiphash.h>
+#include <limits.h> /* UINT_MAX */
+#include <stdio.h> /* *printf */
+#include <string.h> /* mem*, str* */
#include "ipset.h"
+#include <linux/netfilter_ipv4/ip_set_ipportiphash.h>
+
#define OPT_CREATE_HASHSIZE 0x01U
#define OPT_CREATE_PROBES 0x02U
#define OPT_CREATE_RESIZE 0x04U
else
exit_error(PARAMETER_PROBLEM,
"IP address, port and IP address must be specified: ip,port,ip");
- free(saved);
+ ipset_free(saved);
return 1;
};
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <arpa/inet.h>
-
-#include <linux/netfilter_ipv4/ip_set_ipportnethash.h>
+#include <limits.h> /* UINT_MAX */
+#include <stdio.h> /* *printf */
+#include <string.h> /* mem*, str* */
#include "ipset.h"
+#include <linux/netfilter_ipv4/ip_set_ipportnethash.h>
+
#define OPT_CREATE_HASHSIZE 0x01U
#define OPT_CREATE_PROBES 0x02U
#define OPT_CREATE_RESIZE 0x04U
mydata->cidr = cidr;
parse_ip(ptr, &mydata->ip1);
- free(saved);
+ ipset_free(saved);
return 1;
};
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <arpa/inet.h>
+#include <limits.h> /* UINT_MAX */
+#include <stdio.h> /* *printf */
+#include <string.h> /* mem* */
-#include <linux/netfilter_ipv4/ip_set_iptree.h>
#include "ipset.h"
+#include <linux/netfilter_ipv4/ip_set_iptree.h>
+
#define BUFLEN 30;
#define OPT_CREATE_TIMEOUT 0x01U
else
mydata->timeout = 0;
- free(saved);
+ ipset_free(saved);
return 1;
}
* Place, Suite 330, Boston, MA 02111-1307 USA
*/
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <arpa/inet.h>
-
-#include <linux/netfilter_ipv4/ip_set_iptreemap.h>
+#include <limits.h> /* UINT_MAX */
+#include <stdio.h> /* *printf */
+#include <string.h> /* mem* */
#include "ipset.h"
+#include <linux/netfilter_ipv4/ip_set_iptreemap.h>
+
#define OPT_CREATE_GC 0x1
static void
}
}
- free(saved);
+ ipset_free(saved);
return 1;
}
*/
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <arpa/inet.h>
-#include <linux/if_ether.h>
+#include <stdio.h> /* *printf */
+#include <stdlib.h> /* mem* */
+#include <string.h> /* str* */
+#include <net/ethernet.h> /* ETH_ALEN */
-#include <linux/netfilter_ipv4/ip_set_macipmap.h>
#include "ipset.h"
+#include <linux/netfilter_ipv4/ip_set_macipmap.h>
+
#define BUFLEN 30;
#define OPT_CREATE_FROM 0x01U
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <arpa/inet.h>
-
-#include <linux/netfilter_ipv4/ip_set_nethash.h>
+#include <limits.h> /* UINT_MAX */
+#include <stdio.h> /* *printf */
+#include <string.h> /* mem*, str* */
#include "ipset.h"
+#include <linux/netfilter_ipv4/ip_set_nethash.h>
+
#define BUFLEN 30;
#define OPT_CREATE_HASHSIZE 0x01U
if (!mydata->ip)
exit_error(PARAMETER_PROBLEM,
"Zero valued IP address `%s' specified", ptr);
- free(saved);
+ ipset_free(saved);
return mydata->ip;
};
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;
"Out of range cidr `%s' specified", str);
parse_ip(ptr, ip);
- free(saved);
+ ipset_free(saved);
*ip = pack_ip_cidr(*ip, cidr);
}
*/
-#include <stdio.h>
-#include <string.h>
-#include <arpa/inet.h>
+#include <stdio.h> /* *printf */
+#include <string.h> /* mem* */
-#include <linux/netfilter_ipv4/ip_set_portmap.h>
#include "ipset.h"
+#include <linux/netfilter_ipv4/ip_set_portmap.h>
#define BUFLEN 30;
}
cidr[29] = 0;
}
+#else
+#include <arpa/inet.h>
#endif /* __KERNEL */
#ifndef UINT16_MAX