+4.2
+ - Checking null entries when listing/saving hash types of sets
+ deleted because it's unnecessary and can mask possible errors.
+
4.1
- Manpage fixes and corrections (Jan Engelhardt)
V=0
endif
-IPSET_VERSION:=4.1
+IPSET_VERSION:=4.2
PREFIX:=/usr/local
LIBDIR:=$(PREFIX)/lib
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);
}
}
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);
}
}
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);
}
}
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);
}
}
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);
}
}
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);
}
}
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);
}
}
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);
}
}
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);
}
}
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);
}
}
+4.2
+ - nethash and ipportnethash types counted every entry twice
+ which could produce bogus entries when listing/saving these types
+ of sets (bug reported by Husnu Demir)
+
4.1
- Do not use init_MUTEX either (Jan Engelhardt)
- Improve listing/saving hash type of sets by not copying empty
if (ret == 0) {
if (!map->nets[cidr-1]++)
add_cidr_size(map->cidr, cidr);
- map->elements++;
}
return ret;
}
if (ret == 0) {
if (!map->nets[cidr-1]++)
add_cidr_size(map->cidr, cidr);
- map->elements++;
}
return ret;