Subject: i386 vs x86_64 struct tpacket_hdr layout

From: Norbert van Bolhuis <[email-masked]>
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 ?

thanks,
Norbert van Bolhuis