--- old/src/java.base/unix/native/libnet/PlainDatagramSocketImpl.c 2020-05-20 18:01:24.043687483 -0700 +++ new/src/java.base/unix/native/libnet/PlainDatagramSocketImpl.c 2020-05-20 18:01:23.659680110 -0700 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2020, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -27,10 +27,6 @@ #include #include -#if defined(__solaris__) -#include -#endif - #include "net_util.h" #include "java_net_PlainDatagramSocketImpl.h" @@ -52,12 +48,6 @@ #endif #endif // __linux__ -#ifdef __solaris__ -#ifndef BSD_COMP -#define BSD_COMP -#endif -#endif - #ifndef IPTOS_TOS_MASK #define IPTOS_TOS_MASK 0x1e #endif @@ -498,14 +488,6 @@ n = NET_RecvFrom(fd, buf, 1, MSG_PEEK, &rmtaddr.sa, &slen); if (n == -1) { - -#ifdef __solaris__ - if (errno == ECONNREFUSED) { - int orig_errno = errno; - recv(fd, buf, 1, 0); - errno = orig_errno; - } -#endif if (errno == ECONNREFUSED) { JNU_ThrowByName(env, JNU_JAVANETPKG "PortUnreachableException", "ICMP Port Unreachable"); @@ -632,14 +614,6 @@ n = packetBufferLen; } if (n == -1) { - -#ifdef __solaris__ - if (errno == ECONNREFUSED) { - int orig_errno = errno; - (void) recv(fd, fullPacket, 1, 0); - errno = orig_errno; - } -#endif (*env)->SetIntField(env, packet, dp_offsetID, 0); (*env)->SetIntField(env, packet, dp_lengthID, 0); if (errno == ECONNREFUSED) { @@ -1853,10 +1827,9 @@ * we must use the IPv4 socket options. This is because the IPv6 socket options * don't support IPv4-mapped addresses. This is true as per 2.2.19 and 2.4.7 * kernel releases. In the future it's possible that IP_ADD_MEMBERSHIP - * will be updated to return ENOPROTOOPT if uses with an IPv6 socket (Solaris - * already does this). Thus to cater for this we first try with the IPv4 - * socket options and if they fail we use the IPv6 socket options. This - * seems a reasonable failsafe solution. + * will be updated to return ENOPROTOOPT if uses with an IPv6 socket. Thus to + * cater for this we first try with the IPv4 socket options and if they fail we + * use the IPv6 socket options. This seems a reasonable failsafe solution. */ static void mcast_join_leave(JNIEnv *env, jobject this, jobject iaObj, jobject niObj,