8232097: (sctp) SctpNet.init() results in java.lang.UnsatisfiedLinkError
Reviewed-by: alanb
--- a/src/jdk.sctp/unix/classes/sun/nio/ch/sctp/SctpMultiChannelImpl.java Thu Nov 21 12:14:26 2019 +0000
+++ b/src/jdk.sctp/unix/classes/sun/nio/ch/sctp/SctpMultiChannelImpl.java Thu Nov 21 12:14:28 2019 +0000
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2009, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2009, 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
@@ -991,15 +991,4 @@
return SctpChannelImpl.send0(fd, address, length, addr, port, assocId,
streamNumber, unordered, ppid);
}
-
- static {
- IOUtil.load(); /* loads nio & net native libraries */
- java.security.AccessController.doPrivileged(
- new java.security.PrivilegedAction<Void>() {
- public Void run() {
- System.loadLibrary("sctp");
- return null;
- }
- });
- }
}
--- a/src/jdk.sctp/unix/classes/sun/nio/ch/sctp/SctpNet.java Thu Nov 21 12:14:26 2019 +0000
+++ b/src/jdk.sctp/unix/classes/sun/nio/ch/sctp/SctpNet.java Thu Nov 21 12:14:28 2019 +0000
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2009, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2009, 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
@@ -335,6 +335,14 @@
static native void init();
static {
+ IOUtil.load(); // loads nio & net native libraries
+ java.security.AccessController.doPrivileged(
+ new java.security.PrivilegedAction<Void>() {
+ public Void run() {
+ System.loadLibrary("sctp");
+ return null;
+ }
+ });
init();
}
}