]> git.ipfire.org Git - thirdparty/xtables-addons.git/commitdiff
ipset: update to 4.2
authorJan Engelhardt <jengelh@medozas.de>
Mon, 25 Jan 2010 10:54:34 +0000 (11:54 +0100)
committerJan Engelhardt <jengelh@medozas.de>
Mon, 25 Jan 2010 10:54:34 +0000 (11:54 +0100)
doc/changelog.txt
extensions/ipset/ip_set_ipportnethash.c
extensions/ipset/ip_set_nethash.c
extensions/ipset/ipset.c
extensions/ipset/ipset_iphash.c
extensions/ipset/ipset_ipporthash.c
extensions/ipset/ipset_ipportiphash.c
extensions/ipset/ipset_ipportnethash.c
extensions/ipset/ipset_nethash.c

index 085640b78ea2617f2fcbc12352e4377f9635f7f8..01d72f29db1247ef7416fdfad0f34cec276657b9 100644 (file)
@@ -1,6 +1,7 @@
 
 HEAD
 ====
+- ipset: update to 4.2
 
 
 Xtables-addons 1.22 (January 22 2009)
index a66b1c22521b9c94fd3cced07e04ca10ccc84be4..e9900b128e6ca08a0729a2a34fb2e55f38001f4e 100644 (file)
@@ -185,7 +185,6 @@ ipportnethash_add(struct ip_set *set,
        if (ret == 0) {
                if (!map->nets[cidr-1]++)
                        add_cidr_size(map->cidr, cidr);
-               map->elements++;
        }
        return ret;
 }
index 96314a7ee586421c82e415ce78bd7501abad3b13..990b5d7190b1a3520cec33e910d1a8e5374e9181 100644 (file)
@@ -136,7 +136,6 @@ nethash_add(struct ip_set *set, ip_set_ip_t ip, uint8_t cidr)
        if (ret == 0) {
                if (!map->nets[cidr-1]++)
                        add_cidr_size(map->cidr, cidr);
-               map->elements++;
        }
        
        return ret;
index 98a6ca57579e8a3df870d64f89146e117d922516..031ef1542b25b264f870e752806579f988551dc5 100644 (file)
@@ -30,7 +30,7 @@
 #define PROC_SYS_MODPROBE "/proc/sys/kernel/modprobe"
 #endif
 
-#define IPSET_VERSION "4.1"
+#define IPSET_VERSION "4.2"
 
 char program_name[] = "ipset";
 char program_version[] = IPSET_VERSION;
index dfaf23de5d2971e462227bc546c9d7c9b846b89a..feb089bad723f1eb165e3c1811c91e6dd14e148b 100644 (file)
@@ -200,8 +200,7 @@ iphash_printips(struct set *set UNUSED, void *data, u_int32_t len,
 
        while (offset < len) {
                ip = data + offset;
-               if (*ip)
-                       printf("%s\n", ip_tostring(*ip, options));
+               printf("%s\n", ip_tostring(*ip, options));
                offset += IPSET_VALIGN(sizeof(ip_set_ip_t), dont_align);
        }
 }
@@ -230,9 +229,7 @@ iphash_saveips(struct set *set UNUSED, void *data, u_int32_t len,
 
        while (offset < len) {
                ip = data + offset;
-               if (*ip)
-                       printf("-A %s %s\n", set->name, 
-                              ip_tostring(*ip, options));
+               printf("-A %s %s\n", set->name, ip_tostring(*ip, options));
                offset += IPSET_VALIGN(sizeof(ip_set_ip_t), dont_align);
        }
 }
index 439b475f96ee58e42d7fa82be32e091a906cedbf..f03f36c19518953975e2d4ca3516c7ce178e2554 100644 (file)
@@ -259,13 +259,11 @@ ipporthash_printips(struct set *set, void *data, u_int32_t len,
 
        while (offset < len) {
                ipptr = data + offset;
-               if (*ipptr) {
-                       ip = (*ipptr>>16) + mysetdata->first_ip;
-                       port = (uint16_t) *ipptr;
-                       printf("%s,%s\n", 
-                              ip_tostring(ip, options),
-                              port_tostring(port, options));
-               }
+               ip = (*ipptr>>16) + mysetdata->first_ip;
+               port = (uint16_t) *ipptr;
+               printf("%s,%s\n", 
+                      ip_tostring(ip, options),
+                      port_tostring(port, options));
                offset += IPSET_VALIGN(sizeof(ip_set_ip_t), dont_align);
        }
 }
@@ -296,13 +294,11 @@ ipporthash_saveips(struct set *set, void *data, u_int32_t len,
 
        while (offset < len) {
                ipptr = data + offset;
-               if (*ipptr) {
-                       ip = (*ipptr>>16) + mysetdata->first_ip;
-                       port = (uint16_t) *ipptr;
-                       printf("-A %s %s,%s\n", set->name, 
-                              ip_tostring(ip, options),
-                              port_tostring(port, options));
-               }
+               ip = (*ipptr>>16) + mysetdata->first_ip;
+               port = (uint16_t) *ipptr;
+               printf("-A %s %s,%s\n", set->name, 
+                      ip_tostring(ip, options),
+                      port_tostring(port, options));
                offset += IPSET_VALIGN(sizeof(ip_set_ip_t), dont_align);
        }
 }
index 5d766e77a7d5f1a54d402380b84e29e04529a306..73739bfe9423384d44ead1ca513ae242d24b7ebd 100644 (file)
@@ -265,15 +265,13 @@ ipportiphash_printips(struct set *set, void *data, u_int32_t len,
 
        while (offset < len) {
                ipptr = data + offset;
-               if (ipptr->ip && ipptr->ip1) {
-                       ip = (ipptr->ip>>16) + mysetdata->first_ip;
-                       port = (uint16_t) ipptr->ip;
-                       printf("%s,%s,", 
-                              ip_tostring(ip, options),
-                              port_tostring(port, options));
-                       printf("%s\n", 
-                              ip_tostring(ipptr->ip1, options));
-               }
+               ip = (ipptr->ip>>16) + mysetdata->first_ip;
+               port = (uint16_t) ipptr->ip;
+               printf("%s,%s,", 
+                      ip_tostring(ip, options),
+                      port_tostring(port, options));
+               printf("%s\n", 
+                      ip_tostring(ipptr->ip1, options));
                offset += IPSET_VALIGN(sizeof(struct ipportip), dont_align);
        }
 }
@@ -305,15 +303,13 @@ ipportiphash_saveips(struct set *set, void *data, u_int32_t len,
 
        while (offset < len) {
                ipptr = data + offset;
-               if (ipptr->ip && ipptr->ip1) {
-                       ip = (ipptr->ip>>16) + mysetdata->first_ip;
-                       port = (uint16_t) ipptr->ip;
-                       printf("-A %s %s,%s,", set->name, 
-                              ip_tostring(ip, options),
-                              port_tostring(port, options));
-                       printf("%s\n",
-                              ip_tostring(ipptr->ip1, options));
-               }
+               ip = (ipptr->ip>>16) + mysetdata->first_ip;
+               port = (uint16_t) ipptr->ip;
+               printf("-A %s %s,%s,", set->name, 
+                      ip_tostring(ip, options),
+                      port_tostring(port, options));
+               printf("%s\n",
+                      ip_tostring(ipptr->ip1, options));
                offset += IPSET_VALIGN(sizeof(struct ipportip), dont_align);
        }
 }
index 3c9025ba602faf12e889a65ea172154d3df0b2e0..036719eca9318b659c711028b05d695677803881 100644 (file)
@@ -330,15 +330,13 @@ ipportnethash_printips(struct set *set, void *data, u_int32_t len,
 
        while (offset < len) {
                ipptr = data + offset;
-               if (ipptr->ip || ipptr->ip1) {
-                       ip = (ipptr->ip>>16) + mysetdata->first_ip;
-                       port = (uint16_t) ipptr->ip;
-                       printf("%s,%s,", 
-                              ip_tostring(ip, options),
-                              port_tostring(port, options));
-                       printf("%s\n", 
-                              unpack_ip_tostring(ipptr->ip1, options));
-               }
+               ip = (ipptr->ip>>16) + mysetdata->first_ip;
+               port = (uint16_t) ipptr->ip;
+               printf("%s,%s,", 
+                      ip_tostring(ip, options),
+                      port_tostring(port, options));
+               printf("%s\n", 
+                      unpack_ip_tostring(ipptr->ip1, options));
                offset += IPSET_VALIGN(sizeof(struct ipportip), dont_align);
        }
 }
@@ -370,15 +368,13 @@ ipportnethash_saveips(struct set *set, void *data, u_int32_t len,
 
        while (offset < len) {
                ipptr = data + offset;
-               if (ipptr) {
-                       ip = (ipptr->ip>>16) + mysetdata->first_ip;
-                       port = (uint16_t) ipptr->ip;
-                       printf("-A %s %s,%s,", set->name, 
-                              ip_tostring(ip, options),
-                              port_tostring(port, options));
-                       printf("%s\n",
-                              unpack_ip_tostring(ipptr->ip, options));
-               }
+               ip = (ipptr->ip>>16) + mysetdata->first_ip;
+               port = (uint16_t) ipptr->ip;
+               printf("-A %s %s,%s,", set->name, 
+                      ip_tostring(ip, options),
+                      port_tostring(port, options));
+               printf("%s\n",
+                      unpack_ip_tostring(ipptr->ip, options));
                offset += IPSET_VALIGN(sizeof(struct ipportip), dont_align);
        }
 }
index 24db35528d833b5f6056c195c67e8b2c352bb010..4f6f156e9a98e55c1b9226e525bea1120e747bb0 100644 (file)
@@ -232,8 +232,7 @@ nethash_printips(struct set *set UNUSED, void *data, u_int32_t len,
 
        while (offset < len) {
                ip = data + offset;
-               if (*ip)
-                       printf("%s\n", unpack_ip_tostring(*ip, options));
+               printf("%s\n", unpack_ip_tostring(*ip, options));
                offset += IPSET_VALIGN(sizeof(ip_set_ip_t), dont_align);
        }
 }
@@ -258,9 +257,8 @@ nethash_saveips(struct set *set UNUSED, void *data, u_int32_t len,
 
        while (offset < len) {
                ip = data + offset;
-               if (*ip)
-                       printf("-A %s %s\n", set->name, 
-                              unpack_ip_tostring(*ip, options));
+               printf("-A %s %s\n", set->name,
+                      unpack_ip_tostring(*ip, options));
                offset += IPSET_VALIGN(sizeof(ip_set_ip_t), dont_align);
        }
 }