summaryrefslogtreecommitdiff
path: root/ring_rx.c
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_rx.c
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_rx.c')
-rw-r--r--ring_rx.c4
1 files changed, 4 insertions, 0 deletions
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,