From: Patrick McHardy <kaber@trash.net>
To: Lutz Jaenicke <ljaenicke@innominate.com>
Cc: netfilter-devel@vger.kernel.org
Subject: Re: [PATCH 1/1] netfilter: nf_ct_tcp: pack nf_ct_tcp_flags to match user space
Date: Mon, 15 Mar 2010 17:57:32 +0100 [thread overview]
Message-ID: <4B9E66FC.10303@trash.net> (raw)
In-Reply-To: <1268157924-4879-2-git-send-email-ljaenicke@innominate.com>
Lutz Jaenicke wrote:
> On some platforms (here: Intel IXP4xx ARM big endian)
> sizeof(struct nf_ct_tcp_flags) evaluates to 4 bytes while in the user
> space code 2 bytes is hard coded.
> Add "__attribute__ ((__packed__))" to enforce matching structure
> sizes.
>
> Signed-off-by: Lutz Jaenicke <ljaenicke@innominate.com>
> ---
> include/linux/netfilter/nf_conntrack_tcp.h | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/include/linux/netfilter/nf_conntrack_tcp.h b/include/linux/netfilter/nf_conntrack_tcp.h
> index 6e135f9..9d4cf26 100644
> --- a/include/linux/netfilter/nf_conntrack_tcp.h
> +++ b/include/linux/netfilter/nf_conntrack_tcp.h
> @@ -42,7 +42,7 @@ enum tcp_conntrack {
> struct nf_ct_tcp_flags {
> __u8 flags;
> __u8 mask;
> -};
> +} __attribute__ ((packed));
I would prefer to fix userspace to use sizeof(...) instead of
using packed structs in the kernel. AFAICT, that should also
work on all architectures.
next prev parent reply other threads:[~2010-03-15 16:57 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-03-09 18:05 [PATCH 0/1] Adjust nfnetlink structure size between kernel and user space Lutz Jaenicke
2010-03-09 18:05 ` [PATCH 1/1] netfilter: nf_ct_tcp: pack nf_ct_tcp_flags to match " Lutz Jaenicke
2010-03-15 16:57 ` Patrick McHardy [this message]
2010-03-15 18:04 ` Jan Engelhardt
2010-03-15 19:03 ` David Miller
-- strict thread matches above, loose matches on Subject: below --
2010-03-09 16:48 [PATCH 0/1] Adjust nfnetlink structure size between kernel and " Lutz Jaenicke
2010-03-09 16:48 ` [PATCH 1/1] netfilter: nf_ct_tcp: pack nf_ct_tcp_flags to match " Lutz Jaenicke
2010-03-09 17:02 ` Eric Dumazet
2010-03-09 17:18 ` Lutz Jaenicke
2010-03-09 17:03 ` Jan Engelhardt
2010-03-09 17:17 ` Lutz Jaenicke
2010-03-09 17:41 ` David Miller
2011-12-30 11:43 ` Lutz Jaenicke
2011-12-31 15:45 ` 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=4B9E66FC.10303@trash.net \
--to=kaber@trash.net \
--cc=ljaenicke@innominate.com \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.