Commit fd735d8b authored by Konstantin Khlebnikov's avatar Konstantin Khlebnikov Committed by Pavel Emelyanov

zdtm: fix struct tpacket_req3 redeclaration

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: 's avatarKonstantin Khlebnikov <khlebnikov@openvz.org>
Acked-by: 's avatarAndrew Vagin <avagin@parallels.com>
Signed-off-by: 's avatarPavel Emelyanov <xemul@parallels.com>
parent cfa21504
...@@ -20,6 +20,7 @@ const char *test_author = "Pavel Emelyanov <xemul@parallels.com>"; ...@@ -20,6 +20,7 @@ const char *test_author = "Pavel Emelyanov <xemul@parallels.com>";
#include <stdlib.h> #include <stdlib.h>
#include <arpa/inet.h> #include <arpa/inet.h>
#include <sys/socket.h> #include <sys/socket.h>
#include <linux/version.h>
#include <linux/if_packet.h> #include <linux/if_packet.h>
#include <net/ethernet.h> #include <net/ethernet.h>
...@@ -67,6 +68,8 @@ struct packet_mreq_max { ...@@ -67,6 +68,8 @@ struct packet_mreq_max {
#define LO_ADDR_LEN 6 #define LO_ADDR_LEN 6
#if LINUX_VERSION_CODE < KERNEL_VERSION(3,2,0)
struct tpacket_req3 { struct tpacket_req3 {
unsigned int tp_block_size; unsigned int tp_block_size;
unsigned int tp_block_nr; unsigned int tp_block_nr;
...@@ -77,6 +80,8 @@ struct tpacket_req3 { ...@@ -77,6 +80,8 @@ struct tpacket_req3 {
unsigned int tp_feature_req_word; unsigned int tp_feature_req_word;
}; };
#endif
int main(int argc, char **argv) int main(int argc, char **argv)
{ {
int sk1, sk2; int sk1, sk2;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment