diff options
author | David S. Miller <davem@davemloft.net> | 2005-06-15 23:51:14 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2005-06-15 23:51:14 -0400 |
commit | bcfff0b471a60df350338bcd727fc9b8a6aa54b2 (patch) | |
tree | f3cb0028c65b96f2d38cc31c578bbc9b6271a85d /net/ipv4 | |
parent | 1016888fb69662936b32ab767c7419a3be9a69d3 (diff) |
[NETFILTER]: ipt_recent: last_pkts is an array of "unsigned long" not "u_int32_t"
This fixes various crashes on 64-bit when using this module.
Based upon a patch by Juergen Kreileder <jk@blackdown.de>.
Signed-off-by: David S. Miller <davem@davemloft.net>
ACKed-by: Patrick McHardy <kaber@trash.net>
Diffstat (limited to 'net/ipv4')
-rw-r--r-- | net/ipv4/netfilter/ipt_recent.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/net/ipv4/netfilter/ipt_recent.c b/net/ipv4/netfilter/ipt_recent.c index 25ab9fabdcba..2d44b07688af 100644 --- a/net/ipv4/netfilter/ipt_recent.c +++ b/net/ipv4/netfilter/ipt_recent.c | |||
@@ -223,7 +223,7 @@ static int ip_recent_ctrl(struct file *file, const char __user *input, unsigned | |||
223 | curr_table->table[count].last_seen = 0; | 223 | curr_table->table[count].last_seen = 0; |
224 | curr_table->table[count].addr = 0; | 224 | curr_table->table[count].addr = 0; |
225 | curr_table->table[count].ttl = 0; | 225 | curr_table->table[count].ttl = 0; |
226 | memset(curr_table->table[count].last_pkts,0,ip_pkt_list_tot*sizeof(u_int32_t)); | 226 | memset(curr_table->table[count].last_pkts,0,ip_pkt_list_tot*sizeof(unsigned long)); |
227 | curr_table->table[count].oldest_pkt = 0; | 227 | curr_table->table[count].oldest_pkt = 0; |
228 | curr_table->table[count].time_pos = 0; | 228 | curr_table->table[count].time_pos = 0; |
229 | curr_table->time_info[count].position = count; | 229 | curr_table->time_info[count].position = count; |
@@ -502,7 +502,7 @@ match(const struct sk_buff *skb, | |||
502 | location = time_info[curr_table->time_pos].position; | 502 | location = time_info[curr_table->time_pos].position; |
503 | hash_table[r_list[location].hash_entry] = -1; | 503 | hash_table[r_list[location].hash_entry] = -1; |
504 | hash_table[hash_result] = location; | 504 | hash_table[hash_result] = location; |
505 | memset(r_list[location].last_pkts,0,ip_pkt_list_tot*sizeof(u_int32_t)); | 505 | memset(r_list[location].last_pkts,0,ip_pkt_list_tot*sizeof(unsigned long)); |
506 | r_list[location].time_pos = curr_table->time_pos; | 506 | r_list[location].time_pos = curr_table->time_pos; |
507 | r_list[location].addr = addr; | 507 | r_list[location].addr = addr; |
508 | r_list[location].ttl = ttl; | 508 | r_list[location].ttl = ttl; |
@@ -631,7 +631,7 @@ match(const struct sk_buff *skb, | |||
631 | r_list[location].last_seen = 0; | 631 | r_list[location].last_seen = 0; |
632 | r_list[location].addr = 0; | 632 | r_list[location].addr = 0; |
633 | r_list[location].ttl = 0; | 633 | r_list[location].ttl = 0; |
634 | memset(r_list[location].last_pkts,0,ip_pkt_list_tot*sizeof(u_int32_t)); | 634 | memset(r_list[location].last_pkts,0,ip_pkt_list_tot*sizeof(unsigned long)); |
635 | r_list[location].oldest_pkt = 0; | 635 | r_list[location].oldest_pkt = 0; |
636 | ans = !info->invert; | 636 | ans = !info->invert; |
637 | } | 637 | } |
@@ -734,10 +734,10 @@ checkentry(const char *tablename, | |||
734 | memset(curr_table->table,0,sizeof(struct recent_ip_list)*ip_list_tot); | 734 | memset(curr_table->table,0,sizeof(struct recent_ip_list)*ip_list_tot); |
735 | #ifdef DEBUG | 735 | #ifdef DEBUG |
736 | if(debug) printk(KERN_INFO RECENT_NAME ": checkentry: Allocating %d for pkt_list.\n", | 736 | if(debug) printk(KERN_INFO RECENT_NAME ": checkentry: Allocating %d for pkt_list.\n", |
737 | sizeof(u_int32_t)*ip_pkt_list_tot*ip_list_tot); | 737 | sizeof(unsigned long)*ip_pkt_list_tot*ip_list_tot); |
738 | #endif | 738 | #endif |
739 | 739 | ||
740 | hold = vmalloc(sizeof(u_int32_t)*ip_pkt_list_tot*ip_list_tot); | 740 | hold = vmalloc(sizeof(unsigned long)*ip_pkt_list_tot*ip_list_tot); |
741 | #ifdef DEBUG | 741 | #ifdef DEBUG |
742 | if(debug) printk(KERN_INFO RECENT_NAME ": checkentry: After pkt_list allocation.\n"); | 742 | if(debug) printk(KERN_INFO RECENT_NAME ": checkentry: After pkt_list allocation.\n"); |
743 | #endif | 743 | #endif |