8244224: Implementation of JEP 381: Remove the Solaris and SPARC Ports

Reviewed-by: alanb, bchristi, dcubed, dfuchs, eosterlund, erikj, glaubitz, ihse, iignatyev, jjiang, kbarrett, ksrini, kvn, naoto, prr, rriggs, serb, sspitsyn, stefank, tschatzl, valeriep, weijun, weijun
This commit is contained in:
Mikael Vidstedt 2020-05-20 17:33:37 -07:00
parent 9fe4b69c1a
commit 071bd521bc
954 changed files with 1093 additions and 127816 deletions

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2009, 2019, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2009, 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
@ -47,11 +47,6 @@ public class SctpNet {
/* -- Miscellaneous SCTP utilities -- */
private static boolean IPv4MappedAddresses() {
if ("SunOS".equals(osName)) {
/* Solaris supports IPv4Mapped Addresses with bindx */
return true;
} /* else { //other OS/implementations */
/* lksctp/linux requires Ipv4 addresses */
return false;
}

View file

@ -26,48 +26,6 @@
#ifndef SUN_NIO_CH_SCTP_H
#define SUN_NIO_CH_SCTP_H
#ifdef __solaris__
#define _XPG4_2
#define __EXTENSIONS__
#include <sys/socket.h>
#include <netinet/sctp.h>
#include "jni.h"
/* Current Solaris headers don't comply with draft rfc */
#ifndef SCTP_EOF
#define SCTP_EOF MSG_EOF
#endif
#ifndef SCTP_UNORDERED
#define SCTP_UNORDERED MSG_UNORDERED
#endif
/* The current version of the socket API extension shipped with Solaris does
* not define the following options that the Java API (optionally) supports */
#ifndef SCTP_EXPLICIT_EOR
#define SCTP_EXPLICIT_EOR -1
#endif
#ifndef SCTP_FRAGMENT_INTERLEAVE
#define SCTP_FRAGMENT_INTERLEAVE -1
#endif
#ifndef SCTP_SET_PEER_PRIMARY_ADDR
#define SCTP_SET_PEER_PRIMARY_ADDR -1
#endif
/* Function types to support dynamic linking of socket API extension functions
* for SCTP. This is so that there is no linkage depandancy during build or
* runtime for libsctp.*/
typedef int sctp_getladdrs_func(int sock, sctp_assoc_t id, void **addrs);
typedef int sctp_freeladdrs_func(void* addrs);
typedef int sctp_getpaddrs_func(int sock, sctp_assoc_t id, void **addrs);
typedef int sctp_freepaddrs_func(void *addrs);
typedef int sctp_bindx_func(int sock, void *addrs, int addrcnt, int flags);
typedef int sctp_peeloff_func(int sock, sctp_assoc_t id);
#else /* __linux__ */
#include <stdint.h>
#include <linux/types.h>
#include <sys/socket.h>
@ -320,8 +278,6 @@ typedef int sctp_bindx_func(int sd, struct sockaddr *addrs, int addrcnt, int fla
typedef int sctp_peeloff_func(int sock, sctp_assoc_t id);
#endif /* __linux__ */
extern sctp_getladdrs_func* nio_sctp_getladdrs;
extern sctp_freeladdrs_func* nio_sctp_freeladdrs;
extern sctp_getpaddrs_func* nio_sctp_getpaddrs;

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2009, 2018, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2009, 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
@ -326,10 +326,11 @@ void handlePeerAddrChange
break;
case SCTP_ADDR_MADE_PRIM :
event = sun_nio_ch_sctp_PeerAddrChange_SCTP_ADDR_MADE_PRIM;
#ifdef __linux__ /* Solaris currently doesn't support SCTP_ADDR_CONFIRMED */
break;
#ifdef __linux__
case SCTP_ADDR_CONFIRMED :
event = sun_nio_ch_sctp_PeerAddrChange_SCTP_ADDR_CONFIRMED;
break;
#endif /* __linux__ */
}
@ -479,20 +480,6 @@ JNIEXPORT jint JNICALL Java_sun_nio_ch_sctp_SctpChannelImpl_receive0
bufp = newBuf;
rv += rvSAVE;
}
#ifdef __sparc
else if ((intptr_t)addr & 0x3) {
/* the given buffer is not 4 byte aligned */
char* newBuf;
if ((newBuf = malloc(SCTP_NOTIFICATION_SIZE)) == NULL) {
JNU_ThrowOutOfMemoryError(env, "Out of native heap space.");
return -1;
}
allocated = JNI_TRUE;
memcpy(newBuf, addr, rv);
bufp = newBuf;
}
#endif
snp = (union sctp_notification *) bufp;
if (handleNotification(env, fd, resultContainerObj, snp, rv,
(msg->msg_flags & MSG_EOR),

View file

@ -358,11 +358,7 @@ JNIEXPORT jobjectArray JNICALL Java_sun_nio_ch_sctp_SctpNet_getLocalAddresses0
int i, addrCount;
jobjectArray isaa;
#ifdef __solaris__
if ((addrCount = nio_sctp_getladdrs(fd, 0, (void **)&addr_buf)) == -1) {
#else /* __linux__ */
if ((addrCount = nio_sctp_getladdrs(fd, 0, (struct sockaddr **)&addr_buf)) == -1) {
#endif
handleSocketError(env, errno);
return NULL;
}
@ -407,11 +403,7 @@ jobjectArray getRemoteAddresses(JNIEnv *env, jint fd, sctp_assoc_t id) {
int i, addrCount;
jobjectArray isaa;
#if defined(__solaris__)
if ((addrCount = nio_sctp_getpaddrs(fd, id, (void **)&addr_buf)) == -1) {
#else /* __linux__ */
if ((addrCount = nio_sctp_getpaddrs(fd, id, (struct sockaddr **)&addr_buf)) == -1) {
#endif
handleSocketError(env, errno);
return NULL;
}