Commit 88ba136d authored by Joerg Willmann's avatar Joerg Willmann Committed by Pablo Neira Ayuso

netfilter: ebtables: fix alignment problem in ppc

ebt_among extension of ebtables uses __alignof__(_xt_align) while the
corresponding kernel module uses __alignof__(ebt_replace) to determine
the alignment in EBT_ALIGN().

These are the results of these values on different platforms:

x86 x86_64 ppc
__alignof__(_xt_align) 4 8 8
__alignof__(ebt_replace) 4 8 4

ebtables fails to add rules which use the among extension.

I'm using kernel 2.6.33 and ebtables 2.0.10-4

According to Bart De Schuymer, userspace alignment was changed to
_xt_align to fix an alignment issue on a userspace32-kernel64 system
(he thinks it was for an ARM device). So userspace must be right.
The kernel alignment macro needs to change so it also uses _xt_align
instead of ebt_replace. The userspace changes date back from
June 29, 2009.
Signed-off-by: default avatarJoerg Willmann <joe@clnt.de>
Signed-off by: Bart De Schuymer <bdschuym@pandora.be>
Signed-off-by: default avatarPablo Neira Ayuso <pablo@netfilter.org>
parent a8db7b2d
...@@ -285,8 +285,8 @@ struct ebt_table { ...@@ -285,8 +285,8 @@ struct ebt_table {
struct module *me; struct module *me;
}; };
#define EBT_ALIGN(s) (((s) + (__alignof__(struct ebt_replace)-1)) & \ #define EBT_ALIGN(s) (((s) + (__alignof__(struct _xt_align)-1)) & \
~(__alignof__(struct ebt_replace)-1)) ~(__alignof__(struct _xt_align)-1))
extern struct ebt_table *ebt_register_table(struct net *net, extern struct ebt_table *ebt_register_table(struct net *net,
const struct ebt_table *table); const struct ebt_table *table);
extern void ebt_unregister_table(struct net *net, struct ebt_table *table); extern void ebt_unregister_table(struct net *net, struct ebt_table *table);
......
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