Hi,
This little patch avoids a build issue on systems different than Linux.

Hope it is useful.

Kindest regards.
From 24d0feb7981ebabf987ee881768eaf2aea685319 Mon Sep 17 00:00:00 2001
From: David CARLIER <dcarl...@afilias.info>
Date: Tue, 29 Sep 2015 14:48:28 +0100
Subject: [PATCH] BUG/MINOR: proto_tcp: Wrong setsockopt flag for other systems
 than Linux.

The SOL_IP flag is available only on Linux, whereas for Solaris and
*BSD flavors it is IPPROTO_IP causing build break in
the silent-drop function.
---
 src/proto_tcp.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/src/proto_tcp.c b/src/proto_tcp.c
index f698889..3642398 100644
--- a/src/proto_tcp.c
+++ b/src/proto_tcp.c
@@ -1456,7 +1456,11 @@ static enum act_return tcp_exec_action_silent_drop(struct act_rule *rule, struct
 	 * network and has no effect on local net.
 	 */
 #ifdef IP_TTL
+#ifdef SOL_IP
 	setsockopt(conn->t.sock.fd, SOL_IP, IP_TTL, &one, sizeof(one));
+#else
+	setsockopt(conn->t.sock.fd, IPPROTO_IP, IP_TTL, &one, sizeof(one));
+#endif
 #endif
  out:
 	/* kill the stream if any */
-- 
2.5.1

Reply via email to