summaryrefslogtreecommitdiffstats
path: root/kernel/ip_set_bitmap_port.c
diff options
context:
space:
mode:
authorJozsef Kadlecsik <kadlec@blackhole.kfki.hu>2010-10-24 21:42:48 +0200
committerJozsef Kadlecsik <kadlec@blackhole.kfki.hu>2010-10-24 21:42:48 +0200
commit0d32c5c070f817229110f92d7b31df9a3e4eeec5 (patch)
tree5ee04a9e03de32d2029ad0d708811e382ca922d1 /kernel/ip_set_bitmap_port.c
parent62a3d29539aa109fed1c8a20d63ef95948b13842 (diff)
Fixes, cleanups, commentsv5.0-pre8
- More comments added to the code - ICMP and ICMPv6 support added to the hash:ip,port, hash:ip,port,ip and hash:ip,port,net types - hash:net and hash:ip,port,net types are reworked - hash:net,port type added - Wrong direction parameters fixed in hash:ip,port - Helps and manpage are updated - More tests added - Ugly macros are rewritten to functions in parse.c (Holger Eitzenberger) - resize related bug in hash types fixed (Holger Eitzenberger) - autoreconf patches by Jan Engelhardt applied - netlink patch minimalized: dumping can be initialized by a second parsing of the message (thanks to David and Patrick for the suggestion) - IPv4/IPv6 address attributes are introduced in order to fix the context (suggested by David)
Diffstat (limited to 'kernel/ip_set_bitmap_port.c')
-rw-r--r--kernel/ip_set_bitmap_port.c13
1 files changed, 4 insertions, 9 deletions
diff --git a/kernel/ip_set_bitmap_port.c b/kernel/ip_set_bitmap_port.c
index c385f99..27363f6 100644
--- a/kernel/ip_set_bitmap_port.c
+++ b/kernel/ip_set_bitmap_port.c
@@ -265,7 +265,7 @@ const struct ip_set_type_variant bitmap_port __read_mostly = {
/* Timeout variant */
struct bitmap_port_timeout {
- void *members; /* the set members */
+ unsigned long *members; /* the set members */
u16 first_port; /* host byte order, included in range */
u16 last_port; /* host byte order, included in range */
size_t memsize; /* members size */
@@ -277,21 +277,17 @@ struct bitmap_port_timeout {
static inline bool
bitmap_port_timeout_test(const struct bitmap_port_timeout *map, u16 id)
{
- unsigned long *timeout = map->members;
-
- return ip_set_timeout_test(timeout[id]);
+ return ip_set_timeout_test(map->members[id]);
}
static int
bitmap_port_timeout_add(const struct bitmap_port_timeout *map,
u16 id, u32 timeout)
{
- unsigned long *table = map->members;
-
if (bitmap_port_timeout_test(map, id))
return -IPSET_ERR_EXIST;
- table[id] = ip_set_timeout_set(timeout);
+ map->members[id] = ip_set_timeout_set(timeout);
return 0;
}
@@ -300,13 +296,12 @@ static int
bitmap_port_timeout_del(const struct bitmap_port_timeout *map,
u16 id)
{
- unsigned long *table = map->members;
int ret = -IPSET_ERR_EXIST;
if (bitmap_port_timeout_test(map, id))
ret = 0;
- table[id] = IPSET_ELEM_UNSET;
+ map->members[id] = IPSET_ELEM_UNSET;
return ret;
}