Skip to content

Commit

Permalink
test-udp: Fix multicast join tests for platforms that need %lo
Browse files Browse the repository at this point in the history
  • Loading branch information
squeek502 committed May 11, 2020
1 parent 46572c3 commit 356968c
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion tests/test-udp.lua
Original file line number Diff line number Diff line change
Expand Up @@ -182,8 +182,15 @@ return require('lib/tap')(function (test)
print("no ipv6 multicast route, skipping")
server:close()
return
elseif errname == "EADDRNOTAVAIL" and multicast_addr == "ff02::1" then
-- OSX, BSDs, and some other platforms need %lo in their multicast/interface addr
-- so try that instead
multicast_addr = "ff02::1%lo0"
interface_addr = "::1%lo0"
assert(uv.udp_set_membership(server, multicast_addr, interface_addr, "join"))
else
assert(not err, err)
end
assert(not err, err)

local client = assert(uv.new_udp())

Expand Down

0 comments on commit 356968c

Please sign in to comment.