changeset 53381:e1da82072c79

8217311: Improve Exception thrown when MulticastSocket.setInterface fails on AIX(Unix) Reviewed-by: sgroeger, alanb, mbaesken, chegar
author clanger
date Fri, 18 Jan 2019 09:04:09 +0100
parents c8208421a860
children 28b79ca141df
files src/java.base/unix/native/libnet/PlainDatagramSocketImpl.c
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/java.base/unix/native/libnet/PlainDatagramSocketImpl.c	Fri Jan 18 08:00:05 2019 +0100
+++ b/src/java.base/unix/native/libnet/PlainDatagramSocketImpl.c	Fri Jan 18 09:04:09 2019 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2019, 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
@@ -1084,7 +1084,7 @@
 
     if (setsockopt(fd, IPPROTO_IPV6, IPV6_MULTICAST_IF,
                    (const char*)&index, sizeof(index)) < 0) {
-        if (errno == EINVAL && index > 0) {
+        if ((errno == EINVAL || errno == EADDRNOTAVAIL) && index > 0) {
             JNU_ThrowByName(env, JNU_JAVANETPKG "SocketException",
                 "IPV6_MULTICAST_IF failed (interface has IPv4 "
                 "address only?)");