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_nethash.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'kernel/ip_set_nethash.c') diff --git a/kernel/ip_set_nethash.c b/kernel/ip_set_nethash.c index a04857c..9b3d826 100644 --- a/kernel/ip_set_nethash.c +++ b/kernel/ip_set_nethash.c @@ -20,8 +20,6 @@ #include -#include -#include #include static int limit = MAX_RANGE; @@ -153,8 +151,8 @@ KADT(nethash, add, ipaddr, cidr) static inline void __nethash_retry(struct ip_set_nethash *tmp, struct ip_set_nethash *map) { - 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_RETRY(nethash, ip_set_ip_t) @@ -190,8 +188,8 @@ static inline int __nethash_create(const struct ip_set_req_nethash_create *req, struct ip_set_nethash *map) { - 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