[[iputils] 2/6] ping: fix building on older systems

Message ID 1359091455-25380-2-git-send-email-vapier@gentoo.org
State Not Applicable, archived
Delegated to: David Miller
Headers show

Commit Message

Mike Frysinger Jan. 25, 2013, 5:24 a.m.
The SO_MARK define is somewhat recent (linux-2.6.25), so check for its
existence before we try to use it.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
 ping_common.c | 2 ++
 1 file changed, 2 insertions(+)


diff --git a/ping_common.c b/ping_common.c
index 7f82851..8d6b145 100644
--- a/ping_common.c
+++ b/ping_common.c
@@ -630,6 +630,7 @@  void setup(int icmp_sock)
 			fprintf(stderr, "Warning: no SO_TIMESTAMP support, falling back to SIOCGSTAMP\n");
+#ifdef SO_MARK
 	if (options & F_MARK) {
 		int ret;
@@ -644,6 +645,7 @@  void setup(int icmp_sock)
 			fprintf(stderr, "Warning: Failed to set mark %d\n", mark);
 	/* Set some SNDTIMEO to prevent blocking forever
 	 * on sends, when device is too slow or stalls. Just put limit