unix, windows: return UV_EINVAL, not UV_EFAULT
A wrong multicast membership should return EINVAL.
This commit is contained in:
parent
017e2d5fde
commit
bdb498f8b1
@ -542,8 +542,7 @@ int uv_udp_set_membership(uv_udp_t* handle, const char* multicast_addr,
|
|||||||
optname = IP_DROP_MEMBERSHIP;
|
optname = IP_DROP_MEMBERSHIP;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
uv__set_sys_error(handle->loop, EFAULT);
|
return uv__set_artificial_error(handle->loop, UV_EINVAL);
|
||||||
return -1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (setsockopt(handle->io_watcher.fd, IPPROTO_IP, optname, (void*) &mreq, sizeof mreq) == -1) {
|
if (setsockopt(handle->io_watcher.fd, IPPROTO_IP, optname, (void*) &mreq, sizeof mreq) == -1) {
|
||||||
|
|||||||
@ -615,8 +615,7 @@ int uv_udp_set_membership(uv_udp_t* handle, const char* multicast_addr,
|
|||||||
optname = IP_DROP_MEMBERSHIP;
|
optname = IP_DROP_MEMBERSHIP;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
uv__set_artificial_error(handle->loop, UV_EFAULT);
|
return uv__set_artificial_error(handle->loop, UV_EINVAL);
|
||||||
return -1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (setsockopt(handle->socket,
|
if (setsockopt(handle->socket,
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user