From a96e4fca10506462df4ee4035f0f86f09bd9dc34 Mon Sep 17 00:00:00 2001 From: "/C=EU/ST=EU/CN=Jozsef Kadlecsik/emailAddress=kadlec@blackhole.kfki.hu" Date: Mon, 20 Oct 2008 10:00:26 +0000 Subject: ipset 2.4 release userspace changes: - Added KBUILD_OUTPUT support (Sven Wegener) - Fix memory leak in ipset_iptreemap (Sven Wegener) - Fix multiple compiler warnings (Sven Wegener) - ipportiphash, ipportnethash and setlist types added - binding marked as deprecated functionality - element separator token changed to ',' in anticipating IPv6 addresses, old separator tokens are still supported - unnecessary includes removed - ipset does not try to resolve IP addresses when listing the content of sets (default changed) - manpage updated - ChangeLog forked for kernel part kernel part changes: - ipportiphash, ipportnethash and setlist types added - set type modules reworked to avoid code duplication as much as possible, code unification macros - expand_macros Makefile target added to help debugging code unification macros - ip_set_addip_kernel and ip_set_delip_kernel changed from void to int, __ip_set_get_byname and __ip_set_put_byid added for the sake of setlist type - unnecessary includes removed - compatibility fix for kernels >= 2.6.27: semaphore.h was moved from asm/ to linux/ (James King) - ChangeLog forked for kernel part --- ipset_iphash.c | 31 +++++++------------------------ 1 file changed, 7 insertions(+), 24 deletions(-) (limited to 'ipset_iphash.c') diff --git a/ipset_iphash.c b/ipset_iphash.c index 573ad63..6dbb84b 100644 --- a/ipset_iphash.c +++ b/ipset_iphash.c @@ -15,22 +15,12 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include -#include #include #include #include -#include -#include -#include -#include -#include #include -#include #include -#include - #include "ipset.h" #define BUFLEN 30; @@ -44,8 +34,7 @@ static void create_init(void *data) { - struct ip_set_req_iphash_create *mydata = - (struct ip_set_req_iphash_create *) data; + struct ip_set_req_iphash_create *mydata = data; DP("create INIT"); @@ -131,8 +120,7 @@ static void create_final(void *data, unsigned int flags) { #ifdef IPSET_DEBUG - struct ip_set_req_iphash_create *mydata = - (struct ip_set_req_iphash_create *) data; + struct ip_set_req_iphash_create *mydata = data; DP("hashsize %u probes %u resize %u", mydata->hashsize, mydata->probes, mydata->resize); @@ -152,8 +140,7 @@ static const struct option create_opts[] = { static ip_set_ip_t adt_parser(unsigned cmd, const char *optarg, void *data) { - struct ip_set_req_iphash *mydata = - (struct ip_set_req_iphash *) data; + struct ip_set_req_iphash *mydata = data; parse_ip(optarg, &mydata->ip); if (!mydata->ip) @@ -170,10 +157,8 @@ adt_parser(unsigned cmd, const char *optarg, void *data) static void initheader(struct set *set, const void *data) { - struct ip_set_req_iphash_create *header = - (struct ip_set_req_iphash_create *) data; - struct ip_set_iphash *map = - (struct ip_set_iphash *) set->settype->header; + const struct ip_set_req_iphash_create *header = data; + struct ip_set_iphash *map = set->settype->header; memset(map, 0, sizeof(struct ip_set_iphash)); map->hashsize = header->hashsize; @@ -201,8 +186,7 @@ mask_to_bits(ip_set_ip_t mask) static void printheader(struct set *set, unsigned options) { - struct ip_set_iphash *mysetdata = - (struct ip_set_iphash *) set->settype->header; + struct ip_set_iphash *mysetdata = set->settype->header; printf(" hashsize: %u", mysetdata->hashsize); printf(" probes: %u", mysetdata->probes); @@ -230,8 +214,7 @@ printips(struct set *set, void *data, size_t len, unsigned options) static void saveheader(struct set *set, unsigned options) { - struct ip_set_iphash *mysetdata = - (struct ip_set_iphash *) set->settype->header; + struct ip_set_iphash *mysetdata = set->settype->header; printf("-N %s %s --hashsize %u --probes %u --resize %u", set->name, set->settype->typename, -- cgit v1.2.3