From 46fb717308d9d717439badd48c150e32a3508a90 Mon Sep 17 00:00:00 2001 From: "/C=EU/ST=EU/CN=Jozsef Kadlecsik/emailAddress=kadlec@blackhole.kfki.hu" Date: Thu, 23 Oct 2008 17:24:30 +0000 Subject: 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. --- kernel/ip_set_ipportnethash.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'kernel/ip_set_ipportnethash.c') 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 -#include -#include #include #include @@ -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; } -- cgit v1.2.3