[8u-dev] Request for backport approval: 8156521: Minor fixes and cleanups in NetworkInterface.c
Chris Hegarty
chris.hegarty at oracle.com
Wed May 25 13:22:36 UTC 2016
> On 25 May 2016, at 14:14, Langer, Christoph <christoph.langer at sap.com> wrote:
>
> Hi Chris,
>
> here is a new webrev with your findings added: http://cr.openjdk.java.net/~clanger/webrevs/8156521.8udev.1/
Thanks. This looks fine.
> I've run builds on Linux, Solaris, Mac and AIX and also ran my basic NetworkInterface test to enumerate all network interfaces and list its properties on these platforms.
Excellent.
> My main motivation for bringing this backport down to 8 is that I'm currently looking at some things in the JDK8 implementation and for that it's good if it's not running too much away from JDK9. Also there were these strncpy findings which I wanted to bring back to OpenJDK8 to reduce the diff to our SAP JVM codebase.
No problem. Just curious is you were seeing issues. It is good
to have the strncpy changes back ported too.
> Can you push the change as I'm not a committer?
Yes, I can sponsor this for you.
-Chris.
> Thanks
> Christoph
>
>
>> -----Original Message-----
>> From: Chris Hegarty [mailto:chris.hegarty at oracle.com]
>> Sent: Mittwoch, 25. Mai 2016 11:07
>> To: Langer, Christoph <christoph.langer at sap.com>
>> Cc: jdk8u-dev at openjdk.java.net; Seán Coffey <sean.coffey at oracle.com>
>> Subject: Re: [8u-dev] Request for backport approval: 8156521: Minor fixes and
>> cleanups in NetworkInterface.c
>>
>>
>>> On 25 May 2016, at 09:12, Seán Coffey <sean.coffey at oracle.com> wrote:
>>>
>>> Approved for jdk8u-dev integration but please ensure you get one review of
>> the jdk8u edits before pushing.
>>>
>>> Regards,
>>> Sean.
>>>
>>> On 24/05/2016 22:43, Langer, Christoph wrote:
>>>> Hi,
>>>>
>>>>
>>>>
>>>> Would you please approve backporting this fix?
>>>>
>>>>
>>>>
>>>> Original Bug: https://bugs.openjdk.java.net/browse/JDK-8156521
>>>>
>>>> Jdk9 change: http://hg.openjdk.java.net/jdk9/dev/jdk/rev/fe3e1508653e
>>>>
>>>> Jdk9 review thread: http://mail.openjdk.java.net/pipermail/net-dev/2016-
>> May/009771.html
>>>>
>>>>
>>>>
>>>> I had to modify the jdk9 patch a little bit to get it to apply to 8udev. This is
>> the according webrev:
>> http://cr.openjdk.java.net/~clanger/webrevs/8156521.8udev/
>>
>> I've taken a look at this and it looks fine. It is a nice cleanup. Is the motivation
>> for the backport request, or something else ? Just curious.
>>
>> Comparing against JDK 9 ( modulo the removal of JVM_ functions and the
>> InetAddress IDs), I have the following suggestions, that will help keep the
>> code more consistent.
>>
>> diff --git a/src/solaris/native/java/net/NetworkInterface.c
>> b/src/solaris/native/java/net/NetworkInterface.c
>> --- a/src/solaris/native/java/net/NetworkInterface.c
>> +++ b/src/solaris/native/java/net/NetworkInterface.c
>> @@ -684,7 +684,7 @@
>> }
>>
>> // Create the array of InetAddresses
>> - addrArr = (*env)->NewObjectArray(env, addr_count, ni_iacls, NULL);
>> + addrArr = (*env)->NewObjectArray(env, addr_count, ni_iacls, NULL);
>> if (addrArr == NULL) {
>> return NULL;
>> }
>> @@ -734,7 +734,7 @@
>> int scope=0;
>> iaObj = (*env)->NewObject(env, ni_ia6cls, ni_ia6ctrID);
>> if (iaObj) {
>> - int ret = setInet6Address_ipaddress(env, iaObj,
>> + jboolean ret = setInet6Address_ipaddress(env, iaObj,
>> (char *)&(((struct sockaddr_in6*)addrP->addr)->sin6_addr));
>> if (ret == JNI_FALSE) {
>> return NULL;
>> @@ -1071,12 +1071,12 @@
>> * if it falls return AF_INET6 socket.
>> */
>> // unused arg ifname and struct if2
>> -static int openSocketWithFallback(JNIEnv *env, const char *ifname){
>> +static int openSocketWithFallback(JNIEnv *env, const char *ifname) {
>> int sock;
>> struct ifreq if2;
>>
>> if ((sock = JVM_Socket(AF_INET, SOCK_DGRAM, 0)) < 0) {
>> - if (errno == EPROTONOSUPPORT){
>> + if (errno == EPROTONOSUPPORT) {
>> if ((sock = JVM_Socket(AF_INET6, SOCK_DGRAM, 0)) < 0) {
>> NET_ThrowByNameWithLastError(env, JNU_JAVANETPKG
>> "SocketException",
>> "IPV6 Socket creation failed");
>> @@ -1873,7 +1873,7 @@
>> struct ifreq if2;
>>
>> if ((sock = JVM_Socket(AF_INET, SOCK_DGRAM, 0)) < 0) {
>> - if (errno == EPROTONOSUPPORT){
>> + if (errno == EPROTONOSUPPORT) {
>> if ((sock = JVM_Socket(AF_INET6, SOCK_DGRAM, 0)) < 0) {
>> NET_ThrowByNameWithLastError(env, JNU_JAVANETPKG
>> "SocketException",
>> "IPV6 Socket creation failed");
>>
>>
>> -Chris.
More information about the jdk8u-dev
mailing list