r7554 - in trunk/ipset: . tests

kadlec at blackhole.kfki.hu kadlec at blackhole.kfki.hu
Wed Jul 2 12:43:29 CEST 2008


Author: kadlec at blackhole.kfki.hu
Date: 2008-07-02 12:43:29 +0200 (Wed, 02 Jul 2008)
New Revision: 7554

Modified:
   trunk/ipset/ChangeLog
   trunk/ipset/Makefile
   trunk/ipset/ipset_iptreemap.c
   trunk/ipset/tests/iptree.t
Log:
Swen's patches applied:
- Remove needless casts from and to void pointers
- testcase timeout race fix



Modified: trunk/ipset/ChangeLog
===================================================================
--- trunk/ipset/ChangeLog	2008-07-02 10:36:01 UTC (rev 7553)
+++ trunk/ipset/ChangeLog	2008-07-02 10:43:29 UTC (rev 7554)
@@ -1,5 +1,6 @@
 [2.3.2]
  - including limits.h for UINT_MAX is required with glibc-2.8 (pud)
+ - needless cast from and to void pointers cleanups in iptreemap (Sven Wegener)
 
 2.3.1
  - segfault on --unbind :all: :all: fixed (reported by bugzilla,

Modified: trunk/ipset/Makefile
===================================================================
--- trunk/ipset/Makefile	2008-07-02 10:36:01 UTC (rev 7553)
+++ trunk/ipset/Makefile	2008-07-02 10:43:29 UTC (rev 7554)
@@ -8,7 +8,7 @@
 KERNEL_DIR=/usr/src/linux
 endif
 
-IPSET_VERSION:=2.3.1
+IPSET_VERSION:=2.3.2
 
 PREFIX:=/usr/local
 LIBDIR:=$(PREFIX)/lib

Modified: trunk/ipset/ipset_iptreemap.c
===================================================================
--- trunk/ipset/ipset_iptreemap.c	2008-07-02 10:36:01 UTC (rev 7553)
+++ trunk/ipset/ipset_iptreemap.c	2008-07-02 10:43:29 UTC (rev 7554)
@@ -31,7 +31,7 @@
 void
 create_init(void *data)
 {
-	struct ip_set_req_iptreemap_create *mydata = (struct ip_set_req_iptreemap_create *) data;
+	struct ip_set_req_iptreemap_create *mydata = data;
 
 	mydata->gc_interval = 0;
 }
@@ -39,7 +39,7 @@
 int
 create_parse(int c, char *argv[], void *data, unsigned int *flags)
 {
-	struct ip_set_req_iptreemap_create *mydata = (struct ip_set_req_iptreemap_create *) data;
+	struct ip_set_req_iptreemap_create *mydata = data;
 
 	switch (c) {
 		case 'g':
@@ -68,7 +68,7 @@
 ip_set_ip_t
 adt_parser(unsigned int cmd, const char *optarg, void *data)
 {
-	struct ip_set_req_iptreemap *mydata = (struct ip_set_req_iptreemap *) data;
+	struct ip_set_req_iptreemap *mydata = data;
 	ip_set_ip_t mask;
 
 	char *saved = ipset_strdup(optarg);
@@ -94,8 +94,8 @@
 void
 initheader(struct set *set, const void *data)
 {
-	struct ip_set_req_iptreemap_create *header = (struct ip_set_req_iptreemap_create *) data;
-	struct ip_set_iptreemap *map = (struct ip_set_iptreemap *) set->settype->header;
+	const struct ip_set_req_iptreemap_create *header = data;
+	struct ip_set_iptreemap *map = set->settype->header;
 
 	map->gc_interval = header->gc_interval;
 }
@@ -103,7 +103,7 @@
 void
 printheader(struct set *set, unsigned int options)
 {
-	struct ip_set_iptreemap *mysetdata = (struct ip_set_iptreemap *) set->settype->header;
+	struct ip_set_iptreemap *mysetdata = set->settype->header;
 
 	if (mysetdata->gc_interval)
 		printf(" gc: %u", mysetdata->gc_interval);
@@ -118,7 +118,7 @@
 	size_t offset = 0;
 
 	while (len >= offset + sizeof(struct ip_set_req_iptreemap)) {
-		req = (struct ip_set_req_iptreemap *) (data + offset);
+		req = data + offset;
 
 		printf("%s", ip_tostring(req->start, options));
 		if (req->start != req->end)
@@ -132,7 +132,7 @@
 void
 saveheader(struct set *set, unsigned int options)
 {
-	struct ip_set_iptreemap *mysetdata = (struct ip_set_iptreemap *) set->settype->header;
+	struct ip_set_iptreemap *mysetdata = set->settype->header;
 
 	printf("-N %s %s", set->name, set->settype->typename);
 
@@ -149,7 +149,7 @@
 	size_t offset = 0;
 
 	while (len >= offset + sizeof(struct ip_set_req_iptreemap)) {
-		req = (struct ip_set_req_iptreemap *) (data + offset);
+		req = data + offset;
 
 		printf("-A %s %s", set->name, ip_tostring(req->start, options));
 

Modified: trunk/ipset/tests/iptree.t
===================================================================
--- trunk/ipset/tests/iptree.t	2008-07-02 10:36:01 UTC (rev 7553)
+++ trunk/ipset/tests/iptree.t	2008-07-02 10:43:29 UTC (rev 7554)
@@ -28,8 +28,8 @@
 1 ipset -T test 2.0.0.2
 # Timeout: Test value not added to the set
 1 ipset -T test 192.168.68.70
-# Timeout: Sleep 5s so that entries can time out
-0 sleep 5
+# Timeout: Sleep 6s so that entries can time out
+0 sleep 6
 # Timeout: Test first random value
 1 ipset -T test 2.0.0.1
 # Timeout: Test second random value




More information about the netfilter-cvslog mailing list