[farsight2/master] tests: Make it build on OSX where RECVERR/ERRQUEUE don't exist
Olivier Crête
olivier.crete at collabora.co.uk
Mon Aug 3 11:56:05 PDT 2009
---
tests/check/transmitter/stunalternd.c | 7 ++++++-
1 files changed, 6 insertions(+), 1 deletions(-)
diff --git a/tests/check/transmitter/stunalternd.c b/tests/check/transmitter/stunalternd.c
index 80b119f..1ee1c34 100644
--- a/tests/check/transmitter/stunalternd.c
+++ b/tests/check/transmitter/stunalternd.c
@@ -115,13 +115,16 @@ int listen_socket (int fam, int type, int proto, unsigned int port)
{
switch (fam)
{
+#ifdef IP_RECVERR
case AF_INET:
setsockopt (fd, SOL_IP, IP_RECVERR, &yes, sizeof (yes));
break;
-
+#endif
+#ifdef IPV6_RECVERR
case AF_INET6:
setsockopt (fd, SOL_IPV6, IPV6_RECVERR, &yes, sizeof (yes));
break;
+#endif
}
}
else
@@ -145,8 +148,10 @@ error:
static int recv_err (int fd)
{
struct msghdr hdr;
+#ifdef MSG_ERRQUEUE
memset (&hdr, 0, sizeof (hdr));
return recvmsg (fd, &hdr, MSG_ERRQUEUE) >= 0;
+#endif
}
--
1.5.6.5
More information about the farsight-commits
mailing list