* [PATCH] ping: fix building on older systems
@ 2011-02-19 17:56 Mike Frysinger
0 siblings, 0 replies; only message in thread
From: Mike Frysinger @ 2011-02-19 17:56 UTC (permalink / raw)
To: YOSHIFUJI Hideaki; +Cc: netdev
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 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/ping_common.c b/ping_common.c
index 82320b1..b4b26b2 100644
--- a/ping_common.c
+++ b/ping_common.c
@@ -475,6 +475,7 @@ void setup(int icmp_sock)
fprintf(stderr, "Warning: no SO_TIMESTAMP support, falling back to SIOCGSTAMP\n");
}
#endif
+#ifdef SO_MARK
if (options & F_MARK) {
if (setsockopt(icmp_sock, SOL_SOCKET, SO_MARK,
&mark, sizeof(mark)) == -1) {
@@ -484,6 +485,7 @@ void setup(int icmp_sock)
fprintf(stderr, "Warning: Failed to set mark %d\n", mark);
}
}
+#endif
/* Set some SNDTIMEO to prevent blocking forever
* on sends, when device is too slow or stalls. Just put limit
--
1.7.4.1
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2011-02-19 17:56 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-02-19 17:56 [PATCH] ping: fix building on older systems Mike Frysinger
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox