Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

uv: upgrade to 332b72e

  • Loading branch information...
commit 4b6164ab491e48f30286f739a8a0e66587499bfd 1 parent 22e2347
Ben Noordhuis bnoordhuis authored
Showing with 9 additions and 9 deletions.
  1. +9 −9 deps/uv/src/unix/udp.c
18 deps/uv/src/unix/udp.c
View
@@ -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);
}
Please sign in to comment.
Something went wrong with that request. Please try again.