tpacket_hdr structure includes 'unsigned long' though kernel and
userland shares it in the mmapped ring buffer.

Seems it would be better to fix all data structures in the header file
than fixing only tpacket_hdr structure.

Signed-off-by: FUJITA Tomonori <[EMAIL PROTECTED]>
Signed-off-by: Mike Christie <[EMAIL PROTECTED]>
---

 include/linux/if_packet.h |   54 +++++++++++++++++++++++----------------------
 1 files changed, 27 insertions(+), 27 deletions(-)

b8afaafd2a40e36daa030a852a5c92f0b6cd7531
diff --git a/include/linux/if_packet.h b/include/linux/if_packet.h
index b925585..bdd1e1e 100644
--- a/include/linux/if_packet.h
+++ b/include/linux/if_packet.h
@@ -3,20 +3,20 @@
 
 struct sockaddr_pkt
 {
-       unsigned short spkt_family;
-       unsigned char spkt_device[14];
-       unsigned short spkt_protocol;
+       __u16   spkt_family;
+       __u8    spkt_device[14];
+       __u16   spkt_protocol;
 };
 
 struct sockaddr_ll
 {
-       unsigned short  sll_family;
-       unsigned short  sll_protocol;
-       int             sll_ifindex;
-       unsigned short  sll_hatype;
-       unsigned char   sll_pkttype;
-       unsigned char   sll_halen;
-       unsigned char   sll_addr[8];
+       __u16   sll_family;
+       __u16   sll_protocol;
+       __s32   sll_ifindex;
+       __u16   sll_hatype;
+       __u8    sll_pkttype;
+       __u8    sll_halen;
+       __u8    sll_addr[8];
 };
 
 /* Packet types */
@@ -42,24 +42,24 @@ struct sockaddr_ll
 
 struct tpacket_stats
 {
-       unsigned int    tp_packets;
-       unsigned int    tp_drops;
+       __u32   tp_packets;
+       __u32   tp_drops;
 };
 
 struct tpacket_hdr
 {
-       unsigned long   tp_status;
+       __u32   tp_status;
 #define TP_STATUS_KERNEL       0
 #define TP_STATUS_USER         1
 #define TP_STATUS_COPY         2
 #define TP_STATUS_LOSING       4
 #define TP_STATUS_CSUMNOTREADY 8
-       unsigned int    tp_len;
-       unsigned int    tp_snaplen;
-       unsigned short  tp_mac;
-       unsigned short  tp_net;
-       unsigned int    tp_sec;
-       unsigned int    tp_usec;
+       __u32   tp_len;
+       __u32   tp_snaplen;
+       __u16   tp_mac;
+       __u16   tp_net;
+       __u32   tp_sec;
+       __u32   tp_usec;
 };
 
 #define TPACKET_ALIGNMENT      16
@@ -81,18 +81,18 @@ struct tpacket_hdr
 
 struct tpacket_req
 {
-       unsigned int    tp_block_size;  /* Minimal size of contiguous block */
-       unsigned int    tp_block_nr;    /* Number of blocks */
-       unsigned int    tp_frame_size;  /* Size of frame */
-       unsigned int    tp_frame_nr;    /* Total number of frames */
+       __u32   tp_block_size;  /* Minimal size of contiguous block */
+       __u32   tp_block_nr;    /* Number of blocks */
+       __u32   tp_frame_size;  /* Size of frame */
+       __u32   tp_frame_nr;    /* Total number of frames */
 };
 
 struct packet_mreq
 {
-       int             mr_ifindex;
-       unsigned short  mr_type;
-       unsigned short  mr_alen;
-       unsigned char   mr_address[8];
+       __s32   mr_ifindex;
+       __u16   mr_type;
+       __u16   mr_alen;
+       __u8    mr_address[8];
 };
 
 #define PACKET_MR_MULTICAST    0
-- 
1.1.3
-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to