summaryrefslogtreecommitdiff
path: root/ring.h
diff options
context:
space:
mode:
authorYousong Zhou <yszhou4tech@gmail.com>2016-09-27 15:04:41 +0800
committerTobias Klauser <tklauser@distanz.ch>2016-09-29 09:29:08 +0200
commit7007975949f5177fbf2514633cc44ba0ac4712c5 (patch)
tree9a0e58e8d0c796ca83f4edfb18fd3a312f23f022 /ring.h
parent4749393697360d02b2612673473163214ff99be1 (diff)
all: fix build on CentOS 6 by checking presence of several macros
Protect usage of macros not present in pre-3.x kernels. Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com> Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
Diffstat (limited to 'ring.h')
-rw-r--r--ring.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/ring.h b/ring.h
index 1886781..d411fc4 100644
--- a/ring.h
+++ b/ring.h
@@ -70,7 +70,11 @@ static inline uint16_t tpacket_uhdr_vlan_proto(union tpacket_uhdr *hdr __maybe_u
static inline bool tpacket_has_vlan_info(union tpacket_uhdr *hdr)
{
- uint32_t valid = TP_STATUS_VLAN_VALID;
+ uint32_t valid = 0;
+
+#ifdef TP_STATUS_VLAN_VALID
+ valid |= TP_STATUS_VLAN_VALID;
+#endif
#ifdef TP_STATUS_VLAN_TPID_VALID
valid |= TP_STATUS_VLAN_TPID_VALID;