From 7007975949f5177fbf2514633cc44ba0ac4712c5 Mon Sep 17 00:00:00 2001 From: Yousong Zhou Date: Tue, 27 Sep 2016 15:04:41 +0800 Subject: 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 Signed-off-by: Tobias Klauser --- ring_rx.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'ring_rx.c') diff --git a/ring_rx.c b/ring_rx.c index 8bfb658..99f8da0 100644 --- a/ring_rx.c +++ b/ring_rx.c @@ -202,12 +202,16 @@ static void join_fanout_group(int sock, uint32_t fanout_group, uint32_t fanout_t if (fanout_group == 0) return; +#if defined(PACKET_FANOUT) fanout_opt = (fanout_group & 0xffff) | (fanout_type << 16); ret = setsockopt(sock, SOL_PACKET, PACKET_FANOUT, &fanout_opt, sizeof(fanout_opt)); if (ret < 0) panic("Cannot set fanout ring mode!\n"); +#else + panic("fanout ring mode is not available!\n"); +#endif } void ring_rx_setup(struct ring *ring, int sock, size_t size, int ifindex, -- cgit v1.2.3-54-g00ecf