diff options
author | Jan Engelhardt <jengelh@medozas.de> | 2008-10-08 11:35:13 +0200 |
---|---|---|
committer | Patrick McHardy <kaber@trash.net> | 2008-10-08 11:35:13 +0200 |
commit | 18219d3f7d6a5bc43825a41e0763158efbdb80d3 (patch) | |
tree | aca133d934ec93fc441d5a26937b2428d23573bd /net/bridge/netfilter/ebt_pkttype.c | |
parent | netfilter: Add documentation for tproxy (diff) | |
download | linux-18219d3f7d6a5bc43825a41e0763158efbdb80d3.tar.gz linux-18219d3f7d6a5bc43825a41e0763158efbdb80d3.tar.bz2 linux-18219d3f7d6a5bc43825a41e0763158efbdb80d3.zip |
netfilter: ebtables: do centralized size checking
Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
Signed-off-by: Patrick McHardy <kaber@trash.net>
Diffstat (limited to 'net/bridge/netfilter/ebt_pkttype.c')
-rw-r--r-- | net/bridge/netfilter/ebt_pkttype.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/net/bridge/netfilter/ebt_pkttype.c b/net/bridge/netfilter/ebt_pkttype.c index 676db32df3d1..019026177f8b 100644 --- a/net/bridge/netfilter/ebt_pkttype.c +++ b/net/bridge/netfilter/ebt_pkttype.c @@ -7,10 +7,10 @@ * April, 2003 * */ - +#include <linux/module.h> +#include <linux/netfilter/x_tables.h> #include <linux/netfilter_bridge/ebtables.h> #include <linux/netfilter_bridge/ebt_pkttype.h> -#include <linux/module.h> static int ebt_filter_pkttype(const struct sk_buff *skb, const struct net_device *in, @@ -28,8 +28,6 @@ static int ebt_pkttype_check(const char *tablename, unsigned int hookmask, { const struct ebt_pkttype_info *info = data; - if (datalen != EBT_ALIGN(sizeof(struct ebt_pkttype_info))) - return -EINVAL; if (info->invert != 0 && info->invert != 1) return -EINVAL; /* Allow any pkt_type value */ @@ -40,6 +38,7 @@ static struct ebt_match filter_pkttype __read_mostly = { .name = EBT_PKTTYPE_MATCH, .match = ebt_filter_pkttype, .check = ebt_pkttype_check, + .matchsize = XT_ALIGN(sizeof(struct ebt_pkttype_info)), .me = THIS_MODULE, }; |