summaryrefslogtreecommitdiffstats
path: root/kernel/ip_set_ipportnethash.c
diff options
context:
space:
mode:
author/C=EU/ST=EU/CN=Jozsef Kadlecsik/emailAddress=kadlec@blackhole.kfki.hu </C=EU/ST=EU/CN=Jozsef Kadlecsik/emailAddress=kadlec@blackhole.kfki.hu>2008-10-23 17:24:30 +0000
committer/C=EU/ST=EU/CN=Jozsef Kadlecsik/emailAddress=kadlec@blackhole.kfki.hu </C=EU/ST=EU/CN=Jozsef Kadlecsik/emailAddress=kadlec@blackhole.kfki.hu>2008-10-23 17:24:30 +0000
commit46fb717308d9d717439badd48c150e32a3508a90 (patch)
tree3a6e1fcaca1b4b7e9a4e8353bb3f3b3db0f2c737 /kernel/ip_set_ipportnethash.c
parentfac5288ad80b7ca2f23d1d5acf6ced98a61fd8eb (diff)
ipset 2.4.2:
- When flushing a nethash/ipportnethash type of set, it can lead to a kernel crash due to a wrong type declaration, bug reported by Krzysztof Oledzki. - iptree and iptreemap types require the header file linux/timer.h, also reported by Krzysztof Oledzki.
Diffstat (limited to 'kernel/ip_set_ipportnethash.c')
-rw-r--r--kernel/ip_set_ipportnethash.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/kernel/ip_set_ipportnethash.c b/kernel/ip_set_ipportnethash.c
index 0f08ba6..3c7f859 100644
--- a/kernel/ip_set_ipportnethash.c
+++ b/kernel/ip_set_ipportnethash.c
@@ -22,8 +22,6 @@
#include <net/ip.h>
-#include <linux/netfilter_ipv4/ip_set.h>
-#include <linux/netfilter_ipv4/ip_set_hashes.h>
#include <linux/netfilter_ipv4/ip_set_ipportnethash.h>
#include <linux/netfilter_ipv4/ip_set_getport.h>
@@ -223,8 +221,8 @@ __ipportnethash_retry(struct ip_set_ipportnethash *tmp,
{
tmp->first_ip = map->first_ip;
tmp->last_ip = map->last_ip;
- memcpy(tmp->cidr, map->cidr, 30 * sizeof(uint8_t));
- memcpy(tmp->nets, map->nets, 30 * sizeof(uint16_t));
+ memcpy(tmp->cidr, map->cidr, sizeof(tmp->cidr));
+ memcpy(tmp->nets, map->nets, sizeof(tmp->nets));
}
HASH_RETRY2(ipportnethash, struct ipportip)
@@ -273,8 +271,8 @@ __ipportnethash_create(const struct ip_set_req_ipportnethash_create *req,
}
map->first_ip = req->from;
map->last_ip = req->to;
- memset(map->cidr, 0, 30 * sizeof(uint8_t));
- memset(map->nets, 0, 30 * sizeof(uint16_t));
+ memset(map->cidr, 0, sizeof(map->cidr));
+ memset(map->nets, 0, sizeof(map->nets));
return 0;
}