Commit 815377fe authored by Jan Engelhardt's avatar Jan Engelhardt Committed by Patrick McHardy

netfilter: ebt_among: obtain match size through different means

The function signatures will be changed to match those of Xtables, and
the datalen argument will be gone. ebt_among unfortunately relies on
it, so we need to obtain it somehow.
Signed-off-by: default avatarJan Engelhardt <jengelh@medozas.de>
Signed-off-by: default avatarPatrick McHardy <kaber@trash.net>
parent 001a18d3
...@@ -178,6 +178,8 @@ ebt_among_check(const char *tablename, unsigned int hookmask, ...@@ -178,6 +178,8 @@ ebt_among_check(const char *tablename, unsigned int hookmask,
const struct ebt_entry *e, void *data, const struct ebt_entry *e, void *data,
unsigned int datalen) unsigned int datalen)
{ {
const struct ebt_entry_match *em =
container_of(data, const struct ebt_entry_match, data);
const struct ebt_among_info *info = data; const struct ebt_among_info *info = data;
int expected_length = sizeof(struct ebt_among_info); int expected_length = sizeof(struct ebt_among_info);
const struct ebt_mac_wormhash *wh_dst, *wh_src; const struct ebt_mac_wormhash *wh_dst, *wh_src;
...@@ -188,11 +190,11 @@ ebt_among_check(const char *tablename, unsigned int hookmask, ...@@ -188,11 +190,11 @@ ebt_among_check(const char *tablename, unsigned int hookmask,
expected_length += ebt_mac_wormhash_size(wh_dst); expected_length += ebt_mac_wormhash_size(wh_dst);
expected_length += ebt_mac_wormhash_size(wh_src); expected_length += ebt_mac_wormhash_size(wh_src);
if (datalen != EBT_ALIGN(expected_length)) { if (em->match_size != EBT_ALIGN(expected_length)) {
printk(KERN_WARNING printk(KERN_WARNING
"ebtables: among: wrong size: %d " "ebtables: among: wrong size: %d "
"against expected %d, rounded to %Zd\n", "against expected %d, rounded to %Zd\n",
datalen, expected_length, em->match_size, expected_length,
EBT_ALIGN(expected_length)); EBT_ALIGN(expected_length));
return false; return false;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment