diff options
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 |
commit | 46fb717308d9d717439badd48c150e32a3508a90 (patch) | |
tree | 3a6e1fcaca1b4b7e9a4e8353bb3f3b3db0f2c737 /kernel/ip_set_nethash.c | |
parent | fac5288ad80b7ca2f23d1d5acf6ced98a61fd8eb (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_nethash.c')
-rw-r--r-- | kernel/ip_set_nethash.c | 10 |
1 files changed, 4 insertions, 6 deletions
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 <net/ip.h> -#include <linux/netfilter_ipv4/ip_set.h> -#include <linux/netfilter_ipv4/ip_set_hashes.h> #include <linux/netfilter_ipv4/ip_set_nethash.h> 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; } |