aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJan Engelhardt <jengelh@medozas.de>2008-10-08 05:35:14 -0400
committerPatrick McHardy <kaber@trash.net>2008-10-08 05:35:14 -0400
commit815377fe344c799228ca6278613ca3100b069ad5 (patch)
tree2d6cb0ea2f8fd484ec8cd740965226ad6a93c906
parent001a18d369f4813ed792629ff4a9a6ade2a4a031 (diff)
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: Jan Engelhardt <jengelh@medozas.de> Signed-off-by: Patrick McHardy <kaber@trash.net>
-rw-r--r--net/bridge/netfilter/ebt_among.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/net/bridge/netfilter/ebt_among.c b/net/bridge/netfilter/ebt_among.c
index 568c890887b5..88b5c9118a75 100644
--- a/net/bridge/netfilter/ebt_among.c
+++ b/net/bridge/netfilter/ebt_among.c
@@ -178,6 +178,8 @@ ebt_among_check(const char *tablename, unsigned int hookmask,
178 const struct ebt_entry *e, void *data, 178 const struct ebt_entry *e, void *data,
179 unsigned int datalen) 179 unsigned int datalen)
180{ 180{
181 const struct ebt_entry_match *em =
182 container_of(data, const struct ebt_entry_match, data);
181 const struct ebt_among_info *info = data; 183 const struct ebt_among_info *info = data;
182 int expected_length = sizeof(struct ebt_among_info); 184 int expected_length = sizeof(struct ebt_among_info);
183 const struct ebt_mac_wormhash *wh_dst, *wh_src; 185 const struct ebt_mac_wormhash *wh_dst, *wh_src;
@@ -188,11 +190,11 @@ ebt_among_check(const char *tablename, unsigned int hookmask,
188 expected_length += ebt_mac_wormhash_size(wh_dst); 190 expected_length += ebt_mac_wormhash_size(wh_dst);
189 expected_length += ebt_mac_wormhash_size(wh_src); 191 expected_length += ebt_mac_wormhash_size(wh_src);
190 192
191 if (datalen != EBT_ALIGN(expected_length)) { 193 if (em->match_size != EBT_ALIGN(expected_length)) {
192 printk(KERN_WARNING 194 printk(KERN_WARNING
193 "ebtables: among: wrong size: %d " 195 "ebtables: among: wrong size: %d "
194 "against expected %d, rounded to %Zd\n", 196 "against expected %d, rounded to %Zd\n",
195 datalen, expected_length, 197 em->match_size, expected_length,
196 EBT_ALIGN(expected_length)); 198 EBT_ALIGN(expected_length));
197 return false; 199 return false;
198 } 200 }