Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 144758
b: refs/heads/master
c: 280f37a
h: refs/heads/master
v: v3
  • Loading branch information
Pablo Neira Ayuso authored and Patrick McHardy committed May 5, 2009
1 parent 32f1be8 commit 1d583d2
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: b98b4947cb79d670fceca0e951c092eea93e9baa
refs/heads/master: 280f37afa2c270ff029cb420b34396aa002909c3
2 changes: 2 additions & 0 deletions trunk/include/linux/netfilter/xt_cluster.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,6 @@ struct xt_cluster_match_info {
u_int32_t flags;
};

#define XT_CLUSTER_NODES_MAX 32

#endif /* _XT_CLUSTER_MATCH_H */
8 changes: 7 additions & 1 deletion trunk/net/netfilter/xt_cluster.c
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,13 @@ static bool xt_cluster_mt_checkentry(const struct xt_mtchk_param *par)
{
struct xt_cluster_match_info *info = par->matchinfo;

if (info->node_mask >= (1 << info->total_nodes)) {
if (info->total_nodes > XT_CLUSTER_NODES_MAX) {
printk(KERN_ERR "xt_cluster: you have exceeded the maximum "
"number of cluster nodes (%u > %u)\n",
info->total_nodes, XT_CLUSTER_NODES_MAX);
return false;
}
if (info->node_mask >= (1ULL << info->total_nodes)) {
printk(KERN_ERR "xt_cluster: this node mask cannot be "
"higher than the total number of nodes\n");
return false;
Expand Down

0 comments on commit 1d583d2

Please sign in to comment.