mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-28 07:14:30 +02:00
8242885: PlainDatagramSocketImpl doesn’t allow for the sending of IPv6 datagrams on macOS with sizes between 65508-65527 bytes
This fix changes the current max size for IPv6 datagrams on macOS from it's current size of 65507, which is the IPv4 limit, to 65527, the actual limit for IPv6 on macOS Reviewed-by: alanb, dfuchs, vtewari
This commit is contained in:
parent
2dda9965cd
commit
7fd5cb6117
5 changed files with 283 additions and 170 deletions
|
@ -48,6 +48,11 @@
|
|||
#endif
|
||||
#endif // __linux__
|
||||
|
||||
#ifdef __APPLE__
|
||||
#define IPV4_SNDBUF_LIMIT 65507
|
||||
#define IPV6_SNDBUF_LIMIT 65527
|
||||
#endif // __APPLE__
|
||||
|
||||
#ifndef IPTOS_TOS_MASK
|
||||
#define IPTOS_TOS_MASK 0x1e
|
||||
#endif
|
||||
|
@ -895,7 +900,7 @@ Java_java_net_PlainDatagramSocketImpl_datagramSocketCreate(JNIEnv *env,
|
|||
}
|
||||
|
||||
#ifdef __APPLE__
|
||||
arg = 65507;
|
||||
arg = (domain == AF_INET6) ? IPV6_SNDBUF_LIMIT : IPV4_SNDBUF_LIMIT;
|
||||
if (setsockopt(fd, SOL_SOCKET, SO_SNDBUF,
|
||||
(char *)&arg, sizeof(arg)) < 0) {
|
||||
getErrorString(errno, tmpbuf, sizeof(tmpbuf));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue