From fd735d8be3b105764a711f02adfc20dd8c49fbdb Mon Sep 17 00:00:00 2001 From: Konstantin Khlebnikov Date: Wed, 12 Sep 2012 14:36:41 +0400 Subject: [PATCH] zdtm: fix struct tpacket_req3 redeclaration MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Linux has it since v3.2 cc -g -O2 -Wall -Werror -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=0 -I../../lib packet_sock.c ../../lib/libzdtmtst.a -o packet_sock packet_sock.c:70:8: error: redefinition of ‘struct tpacket_req3’ In file included from packet_sock.c:23:0: /usr/include/linux/if_packet.h:245:8: note: originally defined here Signed-off-by: Konstantin Khlebnikov Acked-by: Andrew Vagin Signed-off-by: Pavel Emelyanov --- test/zdtm/live/static/packet_sock.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/test/zdtm/live/static/packet_sock.c b/test/zdtm/live/static/packet_sock.c index 3f13166a6..a12e624e1 100644 --- a/test/zdtm/live/static/packet_sock.c +++ b/test/zdtm/live/static/packet_sock.c @@ -20,6 +20,7 @@ const char *test_author = "Pavel Emelyanov "; #include #include #include +#include #include #include @@ -67,6 +68,8 @@ struct packet_mreq_max { #define LO_ADDR_LEN 6 +#if LINUX_VERSION_CODE < KERNEL_VERSION(3,2,0) + struct tpacket_req3 { unsigned int tp_block_size; unsigned int tp_block_nr; @@ -77,6 +80,8 @@ struct tpacket_req3 { unsigned int tp_feature_req_word; }; +#endif + int main(int argc, char **argv) { int sk1, sk2;