From: Norbert van Bolhuis <nvbolhuis@aimvalley•nl>
To: Daniel Borkmann <dborkman@redhat•com>
Cc: David Miller <davem@davemloft•net>, netdev@vger•kernel.org
Subject: Re: i386 vs x86_64 struct tpacket_hdr layout
Date: Fri, 20 Dec 2013 22:22:52 +0100 [thread overview]
Message-ID: <52B4B52C.3030903@aimvalley.nl> (raw)
In-Reply-To: <52B49038.3070307@redhat.com>
On 12/20/13 19:45, Daniel Borkmann wrote:
> On 12/20/2013 07:38 PM, David Miller wrote:
>> From: Norbert van Bolhuis <nvbolhuis@aimvalley•nl>
>> Date: Fri, 20 Dec 2013 14:30:06 +0100
>>
>>>
>>> I'm compiling my 32bit application with -m32 on a x86_64
>>> system/kernel.
>>>
>>> Things aren't working because for my application tp_len is at offset 4
>>> but for the kernel it is at offset 8.
>>>
>>> struct tpacket_hdr {
>>> unsigned long tp_status;
>>> unsigned int tp_len;
>>> unsigned int tp_snaplen;
>>> unsigned short tp_mac;
>>> unsigned short tp_net;
>>> unsigned int tp_sec;
>>> unsigned int tp_usec;
>>> };
>>>
>>> How is this suppose to work ?
>>
>> This is why you should use tpacket layout v2 or v3, rather than v1,
>> they fix these issues.
>
> Norbert, please also read Documentation/networking/packet_mmap.txt
>
> Thanks !
Ah... thanks guys, now I see. struct tpacket2_hdr has fixed layout. I will use v2 (or v3).
I could not find this info in [linux-3.6.8/]Documentation/networking/packet_mmap.txt
though.
---
Norbert.
next prev parent reply other threads:[~2013-12-20 21:23 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-12-20 13:30 i386 vs x86_64 struct tpacket_hdr layout Norbert van Bolhuis
2013-12-20 18:38 ` David Miller
2013-12-20 18:45 ` Daniel Borkmann
2013-12-20 21:22 ` Norbert van Bolhuis [this message]
2014-01-06 22:58 ` single process receives own frames due to PACKET_MMAP Norbert van Bolhuis
2014-01-07 9:32 ` Daniel Borkmann
2014-01-07 10:06 ` Jesper Dangaard Brouer
2014-01-07 13:16 ` Norbert van Bolhuis
2014-01-07 13:47 ` Daniel Borkmann
2014-01-07 14:09 ` Jesper Dangaard Brouer
2014-01-07 15:16 ` Norbert van Bolhuis
2014-01-07 15:26 ` Daniel Borkmann
2014-01-07 15:46 ` Norbert van Bolhuis
2014-01-07 15:57 ` Daniel Borkmann
2014-01-08 14:18 ` Norbert van Bolhuis
2014-01-08 14:24 ` Daniel Borkmann
2014-01-08 14:36 ` Norbert van Bolhuis
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=52B4B52C.3030903@aimvalley.nl \
--to=nvbolhuis@aimvalley$(echo .)nl \
--cc=davem@davemloft$(echo .)net \
--cc=dborkman@redhat$(echo .)com \
--cc=netdev@vger$(echo .)kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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