git://git.onelab.eu
/
linux-2.6.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
linux 2.6.16.38 w/ vs2.0.3-rc1
[linux-2.6.git]
/
net
/
netfilter
/
xt_limit.c
diff --git
a/net/netfilter/xt_limit.c
b/net/netfilter/xt_limit.c
index
ce7fdb7
..
15e4050
100644
(file)
--- a/
net/netfilter/xt_limit.c
+++ b/
net/netfilter/xt_limit.c
@@
-68,7
+68,6
@@
static int
ipt_limit_match(const struct sk_buff *skb,
const struct net_device *in,
const struct net_device *out,
ipt_limit_match(const struct sk_buff *skb,
const struct net_device *in,
const struct net_device *out,
- const struct xt_match *match,
const void *matchinfo,
int offset,
unsigned int protoff,
const void *matchinfo,
int offset,
unsigned int protoff,
@@
-108,13
+107,15
@@
user2credits(u_int32_t user)
static int
ipt_limit_checkentry(const char *tablename,
const void *inf,
static int
ipt_limit_checkentry(const char *tablename,
const void *inf,
- const struct xt_match *match,
void *matchinfo,
unsigned int matchsize,
unsigned int hook_mask)
{
struct xt_rateinfo *r = matchinfo;
void *matchinfo,
unsigned int matchsize,
unsigned int hook_mask)
{
struct xt_rateinfo *r = matchinfo;
+ if (matchsize != XT_ALIGN(sizeof(struct xt_rateinfo)))
+ return 0;
+
/* Check for overflow. */
if (r->burst == 0
|| user2credits(r->avg * r->burst) < user2credits(r->avg)) {
/* Check for overflow. */
if (r->burst == 0
|| user2credits(r->avg * r->burst) < user2credits(r->avg)) {
@@
-139,40
+140,36
@@
ipt_limit_checkentry(const char *tablename,
static struct xt_match ipt_limit_reg = {
.name = "limit",
.match = ipt_limit_match,
static struct xt_match ipt_limit_reg = {
.name = "limit",
.match = ipt_limit_match,
- .matchsize = sizeof(struct xt_rateinfo),
.checkentry = ipt_limit_checkentry,
.checkentry = ipt_limit_checkentry,
- .family = AF_INET,
.me = THIS_MODULE,
};
static struct xt_match limit6_reg = {
.name = "limit",
.match = ipt_limit_match,
.me = THIS_MODULE,
};
static struct xt_match limit6_reg = {
.name = "limit",
.match = ipt_limit_match,
- .matchsize = sizeof(struct xt_rateinfo),
.checkentry = ipt_limit_checkentry,
.checkentry = ipt_limit_checkentry,
- .family = AF_INET6,
.me = THIS_MODULE,
};
.me = THIS_MODULE,
};
-static int __init
xt_limit_
init(void)
+static int __init init(void)
{
int ret;
{
int ret;
- ret = xt_register_match(&ipt_limit_reg);
+ ret = xt_register_match(
AF_INET,
&ipt_limit_reg);
if (ret)
return ret;
if (ret)
return ret;
- ret = xt_register_match(&limit6_reg);
+ ret = xt_register_match(
AF_INET6,
&limit6_reg);
if (ret)
if (ret)
- xt_unregister_match(&ipt_limit_reg);
+ xt_unregister_match(
AF_INET,
&ipt_limit_reg);
return ret;
}
return ret;
}
-static void __exit
xt_limit_
fini(void)
+static void __exit fini(void)
{
{
- xt_unregister_match(&ipt_limit_reg);
- xt_unregister_match(&limit6_reg);
+ xt_unregister_match(
AF_INET,
&ipt_limit_reg);
+ xt_unregister_match(
AF_INET6,
&limit6_reg);
}
}
-module_init(
xt_limit_
init);
-module_exit(
xt_limit_
fini);
+module_init(init);
+module_exit(fini);