netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: sachin sanap <sachin.sanap.1gb@gmail.com>
To: Jan Engelhardt <jengelh@medozas.de>
Cc: netfilter-devel@vger.kernel.org, buytenh@wantstofly.org
Subject: Re: Fwd: ebtables broken for kernel above 2.6.28
Date: Fri, 29 May 2009 16:44:24 +0530	[thread overview]
Message-ID: <17923cc80905290414r5caaaec9t8b6c4ce849c66175@mail.gmail.com> (raw)
In-Reply-To: <alpine.LSU.2.00.0905291156060.9095@fbirervta.pbzchgretzou.qr>

Sorry dint inform you earlier that iam on 32bit ARM machine.
The real problem is the kernel is computing the alignment on
__alignof__(struct _xt_align) and the userspace ebtables is computing
it on __alignof__(struct ebt_entry_target) , which are two different
structs.

I have the following patch for ebtables-v2.0.8-2 that fixes this.



--- ebtables-v2.0.8-2.orig/include/ebtables_u.h 2009-05-29
21:41:32.000000000 +0530
+++ ebtables-v2.0.8-2/include/ebtables_u.h      2009-05-29
21:43:32.000000000 +0530
@@ -25,6 +25,7 @@
 #define EBTABLES_U_H
 #include <netinet/in.h>
 #include <linux/netfilter_bridge/ebtables.h>
+#include <linux/netfilter/x_tables.h>

 #ifndef IPPROTO_SCTP
 #define IPPROTO_SCTP           132
@@ -37,7 +38,7 @@
 #define EXEC_STYLE_DAEMON      1

 #ifndef EBT_MIN_ALIGN
-#define EBT_MIN_ALIGN (__alignof__(struct ebt_entry_target))
+#define EBT_MIN_ALIGN (__alignof__(struct _xt_align))
 #endif
 #define EBT_ALIGN(s) (((s) + (EBT_MIN_ALIGN-1)) & ~(EBT_MIN_ALIGN-1))
 #define ERRORMSG_MAXLEN 128


-Sachin




On Fri, May 29, 2009 at 3:32 PM, Jan Engelhardt <jengelh@medozas.de> wrote:
>
> On Friday 2009-05-29 07:51, sachin sanap wrote:
>
>>Iam facing problem with ebtables binay on 2.6.28 kernel (same binary
>>works well with 2.6.27). Its mostly a structure alignment issue with
>>standard targets like DROP,ACCEPT etc. Message seen by user is
>>"eb_tables: standard target: invalid size 8 != 4"
>>Iam trying to fix it, this mail is just to check if its already fixed
>>by someone else?
>
> Indeed this seems to happen, but only when using a mixed-bitness
> combination:
>
> /tmp/usr/sbin # LD_LIBRARY_PATH=../lib ./ebtables -A INPUT -j ACCEPT
> The kernel doesn't support the ebtables 'filter' table.
>
> /tmp/usr/sbin # uname -a
> Linux sovereign 2.6.29.3-jen80-default #1 SMP 2009-04-06 18:10:58 +0200
> x86_64 x86_64 x86_64 GNU/Linux
>
> /tmp/usr/sbin # file ebtables
> ebtables: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), for
> GNU/Linux 2.6.4, dynamically linked (uses shared libs), stripped
>
> ebtables does work when it is 64-bit too, so the immediate workaround —
> assuming you are on x86 — is to not use a 32-bit userspace with a
> 64-bit kernel.
>
--
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

  reply	other threads:[~2009-05-29 11:14 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <17923cc80905280124t4ed6cf7m87f91e4444146697@mail.gmail.com>
     [not found] ` <4A1EB783.4090801@pandora.be>
2009-05-29  5:51   ` Fwd: ebtables broken for kernel above 2.6.28 sachin sanap
2009-05-29 10:02     ` Jan Engelhardt
2009-05-29 11:14       ` sachin sanap [this message]
2009-05-29 16:20         ` Bart De Schuymer
2009-05-29 17:16           ` Jan Engelhardt
2009-06-02 12:20             ` Patrick McHardy
2009-06-05 13:35               ` Jan Engelhardt
2009-06-05 13:38                 ` Patrick McHardy
2009-06-14 17:42         ` Fwd: " Jan Engelhardt
2009-06-19  6:06           ` Sachin Sanap
2009-06-14 15:47     ` Peter Volkov
2009-06-14 16:54       ` Bart De Schuymer

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=17923cc80905290414r5caaaec9t8b6c4ce849c66175@mail.gmail.com \
    --to=sachin.sanap.1gb@gmail.com \
    --cc=buytenh@wantstofly.org \
    --cc=jengelh@medozas.de \
    --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).