From 8bbf469cb091776c291d2866addcee8a60357068 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sa=C3=BAl=20Ibarra=20Corretg=C3=A9?= Date: Thu, 20 Mar 2014 11:07:00 +0100 Subject: [PATCH] test: fix multicast join test on OSX when using IPv6 When choosing an IPv6 interface all low level APIs use the interface index which can be gathered with if_nametoindex. Passing a 0 means to use the default as per the documentation. On OSX, however, this is not the case and when 0 is specified it gives EADDRNOTAVAIL error. So, we workaround the test, by using the 'lo0' interface on OSX, which has an index of 1. --- test/test-udp-multicast-join6.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/test/test-udp-multicast-join6.c b/test/test-udp-multicast-join6.c index fe619fec..babf61e2 100644 --- a/test/test-udp-multicast-join6.c +++ b/test/test-udp-multicast-join6.c @@ -116,7 +116,11 @@ TEST_IMPL(udp_multicast_join6) { ASSERT(r == 0); /* join the multicast channel */ +#if defined(__APPLE__) + r = uv_udp_set_membership(&client, "ff02::1", "::1%lo0", UV_JOIN_GROUP); +#else r = uv_udp_set_membership(&client, "ff02::1", NULL, UV_JOIN_GROUP); +#endif ASSERT(r == 0); r = uv_udp_recv_start(&client, alloc_cb, cl_recv_cb);