6921111: NullPointerException in PlainDatagramSocketImpl.socketSetOption
Reviewed-by: alanb
--- a/jdk/src/solaris/native/java/net/PlainDatagramSocketImpl.c Tue Apr 06 13:47:59 2010 +0100
+++ b/jdk/src/solaris/native/java/net/PlainDatagramSocketImpl.c Tue Apr 06 15:44:17 2010 +0100
@@ -1143,7 +1143,7 @@
jobject addr;
int i;
- if (ni_addrsID == NULL) {
+ if (ni_addrsID == NULL || ia_addressID == NULL) {
jclass c = (*env)->FindClass(env, "java/net/NetworkInterface");
CHECK_NULL(c);
ni_addrsID = (*env)->GetFieldID(env, c, "addrs",
--- a/jdk/src/windows/native/java/net/TwoStacksPlainDatagramSocketImpl.c Tue Apr 06 13:47:59 2010 +0100
+++ b/jdk/src/windows/native/java/net/TwoStacksPlainDatagramSocketImpl.c Tue Apr 06 15:44:17 2010 +0100
@@ -1579,7 +1579,7 @@
jobject addr;
int i;
- if (ni_addrsID == NULL) {
+ if (ni_addrsID == NULL || ia_familyID == NULL) {
jclass c = (*env)->FindClass(env, "java/net/NetworkInterface");
CHECK_NULL_RETURN (c, -1);
ni_addrsID = (*env)->GetFieldID(env, c, "addrs",