forked from torvalds/linux
-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
netfilter: ebtables: do centralized size checking
Signed-off-by: Jan Engelhardt <[email protected]> Signed-off-by: Patrick McHardy <[email protected]>
- Loading branch information
Showing
20 changed files
with
104 additions
and
88 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,13 +11,13 @@ | |
* Innominate Security Technologies AG <[email protected]> | ||
* September, 2002 | ||
*/ | ||
|
||
#include <linux/netfilter_bridge/ebtables.h> | ||
#include <linux/netfilter_bridge/ebt_ip.h> | ||
#include <linux/ip.h> | ||
#include <net/ip.h> | ||
#include <linux/in.h> | ||
#include <linux/module.h> | ||
#include <linux/netfilter/x_tables.h> | ||
#include <linux/netfilter_bridge/ebtables.h> | ||
#include <linux/netfilter_bridge/ebt_ip.h> | ||
|
||
struct tcpudphdr { | ||
__be16 src; | ||
|
@@ -83,8 +83,6 @@ static int ebt_ip_check(const char *tablename, unsigned int hookmask, | |
{ | ||
const struct ebt_ip_info *info = data; | ||
|
||
if (datalen != EBT_ALIGN(sizeof(struct ebt_ip_info))) | ||
return -EINVAL; | ||
if (e->ethproto != htons(ETH_P_IP) || | ||
e->invflags & EBT_IPROTO) | ||
return -EINVAL; | ||
|
@@ -111,6 +109,7 @@ static struct ebt_match filter_ip __read_mostly = { | |
.name = EBT_IP_MATCH, | ||
.match = ebt_filter_ip, | ||
.check = ebt_ip_check, | ||
.matchsize = XT_ALIGN(sizeof(struct ebt_ip_info)), | ||
.me = THIS_MODULE, | ||
}; | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.