From: Joerg Willmann <joe@clnt.de>
To: Bart De Schuymer <bdschuym@pandora.be>
Cc: netfilter-devel@vger.kernel.org
Subject: Re: alignment problem with ebt_among on ppc
Date: Fri, 10 Feb 2012 13:17:49 +0100 (CET) [thread overview]
Message-ID: <Pine.LNX.4.64.1202101314380.17215@brian.int.clnt.de> (raw)
In-Reply-To: <4F341D0E.3020209@pandora.be>
On Thu, 9 Feb 2012, Bart De Schuymer wrote:
> Op 3/02/2012 8:21, joe@clnt.de schreef:
>> What I've seen is that ebt_among extension of ebtables uses
>> __alignof__(_xt_align) while the corresponding kernel module uses
>> __alignof__(ebt_replace) to determin 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
>>
>> So I assume here we can see why ebtales fails to add rules which use the
>> among extension.
>>
>> I'm using kernel 2.6.33 and ebtables 2.0.10-4
>>
>> Is this a known issue or are there any suggestions how to circumvent this
>> problem?
>> Thankyou very much.
>
> The userspace alignment was changed to _xt_align to fix an alignment issue on
> a userspace32-kernel64 system (I think 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.
> Can you do these changes and provide a patch?
>
Thank you very much for the input. I did the proposed changes which solved
my problem.
See below for the patch (hopefully it's the way you expect it...)
Best regards,
Joerg
---
diff -rupN a/include/linux/netfilter_bridge/ebtables.h
b/include/linux/netfilter_bridge/ebtables.h
--- a/include/linux/netfilter_bridge/ebtables.h 2010-08-02
19:27:18.000000000 +0200
+++ b/include/linux/netfilter_bridge/ebtables.h 2012-02-10
12:01:56.464822589 +0100
@@ -285,8 +285,8 @@ struct ebt_table {
struct module *me;
};
-#define EBT_ALIGN(s) (((s) + (__alignof__(struct ebt_replace)-1)) & \
- ~(__alignof__(struct ebt_replace)-1))
+#define EBT_ALIGN(s) (((s) + (__alignof__(struct _xt_align)-1)) & \
+ ~(__alignof__(struct _xt_align)-1))
extern struct ebt_table *ebt_register_table(struct net *net,
const struct ebt_table
*table);
extern void ebt_unregister_table(struct ebt_table *table);
next prev parent reply other threads:[~2012-02-10 12:18 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-02-03 7:21 alignment problem with ebt_among on ppc joe
2012-02-09 19:22 ` Bart De Schuymer
2012-02-10 12:17 ` Joerg Willmann [this message]
2012-02-10 17:39 ` Jan Engelhardt
2012-02-14 18:31 ` Bart De Schuymer
2012-02-14 19:56 ` Pablo Neira Ayuso
2012-02-21 12:32 ` Pablo Neira Ayuso
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=Pine.LNX.4.64.1202101314380.17215@brian.int.clnt.de \
--to=joe@clnt.de \
--cc=bdschuym@pandora.be \
--cc=netfilter-devel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).