/*
- * Copyright 2005-2023 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2005-2024 The OpenSSL Project Authors. All Rights Reserved.
*
* Licensed under the Apache License 2.0 (the "License"). You may not use
* this file except in compliance with the License. You can obtain a copy
# define NO_RECVMMSG
# endif
# endif
+# if defined(__GNU__)
+ /* GNU/Hurd does not have IP_PKTINFO yet */
+ #undef NO_RECVMSG
+ #define NO_RECVMSG
+# endif
+# if defined(__ANDROID_API__) && __ANDROID_API__ < 21
+# undef NO_RECVMMSG
+# define NO_RECVMMSG
+# endif
# if !defined(M_METHOD)
# if defined(OPENSSL_SYS_WINDOWS) && defined(BIO_HAVE_WSAMSG) && !defined(NO_WSARECVMSG)
# define M_METHOD M_METHOD_WSARECVMSG
|| M_METHOD == M_METHOD_WSARECVMSG
# if defined(__APPLE__)
/*
- * CMSG_SPACE is not a constant expresson on OSX even though POSIX
+ * CMSG_SPACE is not a constant expression on OSX even though POSIX
* says it's supposed to be. This should be adequate.
*/
# define BIO_CMSG_ALLOC_LEN 64
int length;
} bio_dgram_sctp_save_message;
+/*
+ * Note: bio_dgram_data must be first here
+ * as we use dgram_ctrl for underlying dgram operations
+ * which will cast this struct to a bio_dgram_data
+ */
typedef struct bio_dgram_sctp_data_st {
- BIO_ADDR peer;
- unsigned int connected;
- unsigned int _errno;
- unsigned int mtu;
+ bio_dgram_data dgram;
struct bio_dgram_sctp_sndinfo sndinfo;
struct bio_dgram_sctp_rcvinfo rcvinfo;
struct bio_dgram_sctp_prinfo prinfo;
cmsg->cmsg_type = IP_PKTINFO;
info = (struct in_pktinfo *)BIO_CMSG_DATA(cmsg);
-# if !defined(OPENSSL_SYS_WINDOWS) && !defined(OPENSSL_SYS_CYGWIN)
+# if !defined(OPENSSL_SYS_WINDOWS) && !defined(OPENSSL_SYS_CYGWIN) && !defined(__FreeBSD__)
info->ipi_spec_dst = local->s_in.sin_addr;
# endif
info->ipi_addr.s_addr = 0;
if (ret < 0) {
if (BIO_dgram_should_retry(ret)) {
BIO_set_retry_read(b);
- data->_errno = get_last_socket_error();
+ data->dgram._errno = get_last_socket_error();
}
}
if (ret <= 0) {
if (BIO_dgram_should_retry(ret)) {
BIO_set_retry_write(b);
- data->_errno = get_last_socket_error();
+ data->dgram._errno = get_last_socket_error();
}
}
return ret;
* Set to maximum (2^14) and ignore user input to enable transport
* protocol fragmentation. Returns always 2^14.
*/
- data->mtu = 16384;
- ret = data->mtu;
+ data->dgram.mtu = 16384;
+ ret = data->dgram.mtu;
break;
case BIO_CTRL_DGRAM_SET_MTU:
/*
* Set to maximum (2^14) and ignore input to enable transport
* protocol fragmentation. Returns always 2^14.
*/
- data->mtu = 16384;
- ret = data->mtu;
+ data->dgram.mtu = 16384;
+ ret = data->dgram.mtu;
break;
case BIO_CTRL_DGRAM_SET_CONNECTED:
case BIO_CTRL_DGRAM_CONNECT: