[CRIU] [RFC 01/11] Make tpacket_req3 definition conditional

Christopher Covington cov at codeaurora.org
Fri Feb 7 09:04:35 PST 2014


The makefile includes need to be moved for everything to be
defined properly when the configure tests run.

The Ubuntu 12.04 x86_64 GCC and Linaro's 13.08 and newer AArch64
GCC's have the if_packet.h kernel header, but as of 13.12,
the Linaro AArch32 GCC does not.

Change-Id: I363c43fdb81b028f99aac77e15bff9462c87af4b
---
 Makefile            | 5 ++---
 include/sk-packet.h | 2 ++
 2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/Makefile b/Makefile
index f8ee59a..96c3c1e 100644
--- a/Makefile
+++ b/Makefile
@@ -16,9 +16,6 @@ export VERSION_MAJOR VERSION_MINOR VERSION_SUBLEVEL VERSION_EXTRA VERSION_NAME
 #
 #MAKEFLAGS := -r -R
 
-include Makefile.inc
-include Makefile.config
-
 #
 # Common definitions
 #
@@ -109,6 +106,8 @@ export CC MAKE CFLAGS LIBS ARCH DEFINES MAKEFLAGS
 export SRC_DIR SYSCALL-LIB SH RM ARCH_DIR OBJCOPY LDARCH LD
 export cflags-y
 
+include Makefile.inc
+include Makefile.config
 include scripts/Makefile.version
 include scripts/Makefile.rules
 
diff --git a/include/sk-packet.h b/include/sk-packet.h
index 4c740c0..607e7a9 100644
--- a/include/sk-packet.h
+++ b/include/sk-packet.h
@@ -22,7 +22,9 @@ extern int packet_receive_one(struct nlmsghdr *h, void *arg);
 
 #ifndef PACKET_FANOUT
 #define PACKET_FANOUT	18
+#endif
 
+#ifndef TPACKET3_HDRLEN
 struct tpacket_req3 {
 	unsigned int tp_block_size;
 	unsigned int tp_block_nr;
-- 
Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
hosted by the Linux Foundation.



More information about the CRIU mailing list