diff options
author | Ben Noordhuis <info@bnoordhuis.nl> | 2012-01-28 04:30:46 +0400 |
---|---|---|
committer | Ben Noordhuis <info@bnoordhuis.nl> | 2012-01-28 04:30:46 +0400 |
commit | 4b6164ab491e48f30286f739a8a0e66587499bfd (patch) | |
tree | d984d782876c6b1d7c171df2db8504e367357b7b /deps | |
parent | 22e23473ea7fd1a083c43aa33fe4d09c1b6bd34e (diff) |
uv: upgrade to 332b72e
Diffstat (limited to 'deps')
-rw-r--r-- | deps/uv/src/unix/udp.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/deps/uv/src/unix/udp.c b/deps/uv/src/unix/udp.c index 3580e4e576c..91f7d1a2fde 100644 --- a/deps/uv/src/unix/udp.c +++ b/deps/uv/src/unix/udp.c @@ -527,21 +527,21 @@ int uv_udp_set_membership(uv_udp_t* handle, const char* multicast_addr, return 0; \ } -X(multicast_loop, IPPROTO_IP, IP_MULTICAST_LOOP) X(broadcast, SOL_SOCKET, SO_BROADCAST) +X(ttl, IPPROTO_IP, IP_TTL) #undef X -static int uv__udp_set_ttl(uv_udp_t* handle, int option, int ttl) { +static int uv__setsockopt_maybe_char(uv_udp_t* handle, int option, int val) { #if __sun - char arg = ttl; + char arg = val; #else - int arg = ttl; + int arg = val; #endif #if __sun - if (ttl < 0 || ttl > 255) { + if (val < 0 || val > 255) { uv__set_sys_error(handle->loop, EINVAL); return -1; } @@ -556,13 +556,13 @@ static int uv__udp_set_ttl(uv_udp_t* handle, int option, int ttl) { } -int uv_udp_set_ttl(uv_udp_t* handle, int ttl) { - return uv__udp_set_ttl(handle, IP_TTL, ttl); +int uv_udp_set_multicast_ttl(uv_udp_t* handle, int ttl) { + return uv__setsockopt_maybe_char(handle, IP_MULTICAST_TTL, ttl); } -int uv_udp_set_multicast_ttl(uv_udp_t* handle, int ttl) { - return uv__udp_set_ttl(handle, IP_MULTICAST_TTL, ttl); +int uv_udp_set_multicast_loop(uv_udp_t* handle, int on) { + return uv__setsockopt_maybe_char(handle, IP_MULTICAST_LOOP, on); } |