summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@qt.io>2018-09-06 15:12:30 +0200
committerAllan Sandfeld Jensen <allan.jensen@qt.io>2018-09-12 07:44:50 +0000
commitebbf15c58c1dd3540a8e7a98df93a097f325a528 (patch)
tree40e3887a7c8dc7438c10418568b63cddcd27b9e3
parentae14d10af68cd18452ff9f970bc97aaac7a7eb88 (diff)
Update usrsctp
Includes fix for security issue 854883 Change-Id: I53b394402cb44a4b21ab2a27a90175103a810e38 Reviewed-by: Michael BrĂ¼ning <michael.bruning@qt.io>
-rw-r--r--chromium/third_party/usrsctp/usrsctplib/Manual.md22
-rw-r--r--chromium/third_party/usrsctp/usrsctplib/Manual.tex27
-rwxr-xr-xchromium/third_party/usrsctp/usrsctplib/usrsctplib/netinet/sctp_callout.c3
-rwxr-xr-xchromium/third_party/usrsctp/usrsctplib/usrsctplib/netinet/sctp_constants.h35
-rwxr-xr-xchromium/third_party/usrsctp/usrsctplib/usrsctplib/netinet/sctp_crc32.c124
-rwxr-xr-xchromium/third_party/usrsctp/usrsctplib/usrsctplib/netinet/sctp_crc32.h8
-rwxr-xr-xchromium/third_party/usrsctp/usrsctplib/usrsctplib/netinet/sctp_indata.c29
-rwxr-xr-xchromium/third_party/usrsctp/usrsctplib/usrsctplib/netinet/sctp_input.c35
-rwxr-xr-xchromium/third_party/usrsctp/usrsctplib/usrsctplib/netinet/sctp_input.h4
-rwxr-xr-xchromium/third_party/usrsctp/usrsctplib/usrsctplib/netinet/sctp_output.c55
-rwxr-xr-xchromium/third_party/usrsctp/usrsctplib/usrsctplib/netinet/sctp_pcb.h2
-rwxr-xr-xchromium/third_party/usrsctp/usrsctplib/usrsctplib/netinet/sctp_structs.h3
-rwxr-xr-xchromium/third_party/usrsctp/usrsctplib/usrsctplib/netinet/sctp_sysctl.c12
-rwxr-xr-xchromium/third_party/usrsctp/usrsctplib/usrsctplib/netinet/sctp_sysctl.h2
-rwxr-xr-xchromium/third_party/usrsctp/usrsctplib/usrsctplib/netinet/sctp_uio.h12
-rwxr-xr-xchromium/third_party/usrsctp/usrsctplib/usrsctplib/netinet/sctp_usrreq.c6
-rwxr-xr-xchromium/third_party/usrsctp/usrsctplib/usrsctplib/netinet/sctp_var.h4
-rwxr-xr-xchromium/third_party/usrsctp/usrsctplib/usrsctplib/netinet/sctputil.c23
-rw-r--r--chromium/third_party/usrsctp/usrsctplib/usrsctplib/netinet6/sctp6_usrreq.c16
-rwxr-xr-xchromium/third_party/usrsctp/usrsctplib/usrsctplib/netinet6/sctp6_var.h4
-rwxr-xr-xchromium/third_party/usrsctp/usrsctplib/usrsctplib/user_environment.h2
-rwxr-xr-xchromium/third_party/usrsctp/usrsctplib/usrsctplib/user_inpcb.h2
-rwxr-xr-xchromium/third_party/usrsctp/usrsctplib/usrsctplib/user_recv_thread.c40
-rwxr-xr-xchromium/third_party/usrsctp/usrsctplib/usrsctplib/user_socket.c6
-rw-r--r--chromium/third_party/usrsctp/usrsctplib/usrsctplib/usrsctp.h6
25 files changed, 199 insertions, 283 deletions
diff --git a/chromium/third_party/usrsctp/usrsctplib/Manual.md b/chromium/third_party/usrsctp/usrsctplib/Manual.md
index eacae4217f2..7057368844d 100644
--- a/chromium/third_party/usrsctp/usrsctplib/Manual.md
+++ b/chromium/third_party/usrsctp/usrsctplib/Manual.md
@@ -113,7 +113,7 @@ The return code is 0 on success and -1 in case of an error.
### usrsctp_socket()
-A representation of an SCTP endpoint is a socket. Is it created with `usrsctp_socket()`. The function prototype is
+A representation of an SCTP endpoint is a socket. Is it created with `usrsctp_socket()`. The function prototype is:
```c
struct socket *
@@ -125,13 +125,15 @@ usrsctp_socket(int domain,
void *data,
size_t datalen,
struct sctp_rcvinfo,
- int flags),
+ int flags,
+ void *ulp_info),
int (*send_cb)(struct socket *sock,
uint32_t sb_free),
- uint32_t sb_threshold)
+ uint32_t sb_threshold,
+ void *ulp_info)
```
-and the arguments taken from [RFC 6458](http://tools.ietf.org/html/rfc6458) are
+The arguments taken from [RFC 6458](http://tools.ietf.org/html/rfc6458) are:
* domain: PF_INET or PF_INET6 can be used.
* type: In case of a one-to-many style socket it is SOCK_SEQPACKET, in case of a one-to-one style
@@ -139,7 +141,11 @@ socket it is SOCK_STREAM. For an explanation of the differences between the sock
refer to [RFC 6458](http://tools.ietf.org/html/rfc6458).
* protocol: Set IPPROTO_SCTP.
-In usrsctp a callback API can be used. The function pointers of the receive and send callbacks are new arguments to the socket call. They are NULL, if no callback API is used. The `sb_threshold` specifies the amount of free space in the send socket buffer before the send function in the application is called. If a send callback function is specified and `sb_threshold` is 0, the function is called whenever there is room in the send socket buffer.
+In usrsctp, a callback API can be used.
+
+* The function pointers of the receive and send callbacks are new arguments to the socket call. If no callback API is used, these must be `NULL`.
+* The `sb_threshold` specifies the amount of free space in the send socket buffer before the send function in the application is called. If a send callback function is specified and `sb_threshold` is 0, the function is called whenever there is room in the send socket buffer.
+* Additional data may be passed along within the `ulp_info` parameter. This value will be passed to the `receive_cb` when it is invoked.
On success `usrsctp_socket()` returns the pointer to the new socket in the `struct socket` data type. It will be needed in all other system calls. In case of a failure NULL is returned and errno is set to the appropriate error code.
@@ -213,7 +219,7 @@ usrsctp_connect(struct socket *so,
* name: Address of the peer to connect to (`struct sockaddr_in` for an IPv4 address or `struct sockaddr_in6` for an IPv6 address).
* addrlen: Size of the peer's address.
-usrsctp_connect() returns 0 on success and -1 in case of an error.
+`usrsctp_connect()` returns 0 on success and -1 in case of an error.
### usrsctp_shutdown()
@@ -228,7 +234,7 @@ usrsctp_shutdown(struct socket *so, int how)
* SHUT_WR: Disables further send operations, and initiates the SCTP shutdown sequence.
* SHUT_RDWR: Disables further send and receive operations, and initiates the SCTP shutdown sequence.
-`usrsctp_listen()` returns 0 on success and -1 in case of an error.
+`usrsctp_shutdown()` returns 0 on success and -1 in case of an error.
## Sending and Receiving Data
Since the publication of [RFC 6458](http://tools.ietf.org/html/rfc6458) there is only one function for sending and one for receiving
@@ -460,7 +466,7 @@ Transmissions and retransmissions of messages might fail. To protect the system
The default maximum number of retransmissions of an INIT chunks is 8, before an ABORT is sent.
#### usrsctp_sysctl_set_sctp_assoc_rtx_max_default()
-This parameter sets the maximum number of failed retransmissions before the association is aborted. The default vaule is 10.
+This parameter sets the maximum number of failed retransmissions before the association is aborted. The default value is 10.
#### usrsctp_sysctl_set_sctp_path_rtx_max_default()
This parameter sets the maximum number of path failures before the association is aborted. The default value is 5. Notice that the number of paths multiplied by this value should be equal to `sctp_assoc_rtx_max_default`. That means that the default configuration is good for two paths.
diff --git a/chromium/third_party/usrsctp/usrsctplib/Manual.tex b/chromium/third_party/usrsctp/usrsctplib/Manual.tex
index a5215939862..7ec1e1f53b3 100644
--- a/chromium/third_party/usrsctp/usrsctplib/Manual.tex
+++ b/chromium/third_party/usrsctp/usrsctplib/Manual.tex
@@ -191,7 +191,7 @@ The return code is 0 on success and -1 in case of an error.
\subsubsection{usrsctp\_socket()}
A representation of an SCTP endpoint is a socket. Is it created with \textit{usrsctp\_socket()}.
-The function prototype is
+The function prototype is:
\begin{verbatim}
struct socket *
usrsctp_socket(int domain,
@@ -202,25 +202,28 @@ usrsctp_socket(int domain,
void *data,
size_t datalen,
struct sctp_rcvinfo,
- int flags),
+ int flags,
+ void *ulp_info),
int (*send_cb)(struct socket *sock,
uint32_t sb_free),
- uint32_t sb_threshold).
+ uint32_t sb_threshold,
+ void *ulp_info).
\end{verbatim}
-and the arguments taken from RFC~6458 are
+The arguments taken from RFC~6458 are:
\begin{itemize}
-\item domain: PF\_INET or PF\_INET6 can be used.
+\item domain: PF\_INET or PF\_INET6 can be used.
\item type: In case of a one-to-many style socket it is SOCK\_SEQPACKET, in case of a one-to-one style
socket it is SOCK\_STREAM. For an explanation of the differences between the socket types please
refer to RFC~6458.
\item protocol: Set IPPROTO\_SCTP.
\end{itemize}
-In usrsctp a callback API can be used. The function pointers of the receive and send callbacks
-are new arguments to the socket call. They are NULL, if no callback API is used. The sb\_threshold
-specifies the amount of free space in the send socket buffer before the send function in the
-application is called. If a send callback function is specified and sb\_threshold is 0, the function is
-called whenever there is room in the send socket buffer.
+In usrsctp, a callback API can be used.
+\begin{itemize}
+\item The function pointers of the receive and send callbacks are new arguments to the socket call. If no callback API is used, these must be \textit{NULL}.
+\item The \textit{sb\_threshold} specifies the amount of free space in the send socket buffer before the send function in the application is called. If a send callback function is specified and \textit{sb\_threshold} is 0, the function is called whenever there is room in the send socket buffer.
+\item Additional data may be passed along within the \textit{ulp\_info} parameter. This value will be passed to the \textit{receive\_cb} when it is invoked.
+\end{itemize}
On success \textit{usrsctp\_socket()} returns the pointer to the new socket in the \texttt{struct socket} data type.
It will be needed in all other system calls. In case of a failure NULL is returned and
@@ -324,7 +327,7 @@ The arguments are
initiates the SCTP shutdown sequence.
\end{itemize}
\end{itemize}
-\textit{usrsctp\_listen()} returns 0 on success and -1 in case of an error.
+\textit{usrsctp\_shutdown()} returns 0 on success and -1 in case of an error.
\section{Sending and Receiving Data}
Since the publication of RFC~6458 there is only one function for sending and one for receiving
@@ -602,7 +605,7 @@ The default maximum number of retransmissions of an INIT chunks is 8, before an
\subsubsection{usrsctp\_sysctl\_set\_sctp\_assoc\_rtx\_max\_default()}
This parameter sets the maximum number of failed retransmissions before the association is aborted.
-The default vaule is 10.
+The default value is 10.
\subsubsection{usrsctp\_sysctl\_set\_sctp\_path\_rtx\_max\_default()}
This parameter sets the maximum number of path failures before the association is aborted.
diff --git a/chromium/third_party/usrsctp/usrsctplib/usrsctplib/netinet/sctp_callout.c b/chromium/third_party/usrsctp/usrsctplib/usrsctplib/netinet/sctp_callout.c
index 30bfa0d5616..8fc57c7aff0 100755
--- a/chromium/third_party/usrsctp/usrsctplib/usrsctplib/netinet/sctp_callout.c
+++ b/chromium/third_party/usrsctp/usrsctplib/usrsctplib/netinet/sctp_callout.c
@@ -46,6 +46,7 @@
#include <string.h>
#include <stdio.h>
#include <errno.h>
+#include <user_atomic.h>
#include <netinet/sctp_sysctl.h>
#include <netinet/sctp_pcb.h>
#else
@@ -200,7 +201,7 @@ user_sctp_timer_iterate(void *arg)
timeout.tv_usec = 1000 * TIMEOUT_INTERVAL;
select(0, NULL, NULL, NULL, &timeout);
#endif
- if (SCTP_BASE_VAR(timer_thread_should_exit)) {
+ if (atomic_cmpset_int(&SCTP_BASE_VAR(timer_thread_should_exit), 1, 1)) {
break;
}
sctp_handle_tick(MSEC_TO_TICKS(TIMEOUT_INTERVAL));
diff --git a/chromium/third_party/usrsctp/usrsctplib/usrsctplib/netinet/sctp_constants.h b/chromium/third_party/usrsctp/usrsctplib/usrsctplib/netinet/sctp_constants.h
index 525c9586a5d..f9a87a47b2a 100755
--- a/chromium/third_party/usrsctp/usrsctplib/usrsctplib/netinet/sctp_constants.h
+++ b/chromium/third_party/usrsctp/usrsctplib/usrsctplib/netinet/sctp_constants.h
@@ -34,7 +34,7 @@
#ifdef __FreeBSD__
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: head/sys/netinet/sctp_constants.h 324615 2017-10-14 10:02:59Z tuexen $");
+__FBSDID("$FreeBSD: head/sys/netinet/sctp_constants.h 328478 2018-01-27 13:46:55Z tuexen $");
#endif
#ifndef _NETINET_SCTP_CONSTANTS_H_
@@ -398,7 +398,7 @@ extern void getwintimeofday(struct timeval *tv);
/*************0x0000 series*************/
#define SCTP_HEARTBEAT_INFO 0x0001
#if defined(__Userspace__)
-#define SCTP_CONN_ADDRESS 0x0004
+#define SCTP_CONN_ADDRESS 0x0004
#endif
#define SCTP_IPV4_ADDRESS 0x0005
#define SCTP_IPV6_ADDRESS 0x0006
@@ -408,43 +408,34 @@ extern void getwintimeofday(struct timeval *tv);
#define SCTP_HOSTNAME_ADDRESS 0x000b
#define SCTP_SUPPORTED_ADDRTYPE 0x000c
-/* draft-ietf-stewart-tsvwg-strreset-xxx */
+/* RFC 6525 */
#define SCTP_STR_RESET_OUT_REQUEST 0x000d
#define SCTP_STR_RESET_IN_REQUEST 0x000e
#define SCTP_STR_RESET_TSN_REQUEST 0x000f
#define SCTP_STR_RESET_RESPONSE 0x0010
#define SCTP_STR_RESET_ADD_OUT_STREAMS 0x0011
-#define SCTP_STR_RESET_ADD_IN_STREAMS 0x0012
+#define SCTP_STR_RESET_ADD_IN_STREAMS 0x0012
#define SCTP_MAX_RESET_PARAMS 2
-#define SCTP_STREAM_RESET_TSN_DELTA 0x1000
+#define SCTP_STREAM_RESET_TSN_DELTA 0x1000
/*************0x4000 series*************/
/*************0x8000 series*************/
#define SCTP_ECN_CAPABLE 0x8000
-/* draft-ietf-tsvwg-auth-xxx */
+/* RFC 4895 */
#define SCTP_RANDOM 0x8002
#define SCTP_CHUNK_LIST 0x8003
#define SCTP_HMAC_LIST 0x8004
-/*
- * draft-ietf-tsvwg-addip-sctp-xx param=0x8008 len=0xNNNN Byte | Byte | Byte
- * | Byte Byte | Byte ...
- *
- * Where each byte is a chunk type extension supported. For example, to support
- * all chunks one would have (in hex):
- *
- * 80 01 00 09 C0 C1 80 81 82 00 00 00
- *
- * Has the parameter. C0 = PR-SCTP (RFC3758) C1, 80 = ASCONF (addip draft) 81
- * = Packet Drop 82 = Stream Reset 83 = Authentication
- */
-#define SCTP_SUPPORTED_CHUNK_EXT 0x8008
+/* RFC 4820 */
+#define SCTP_PAD 0x8005
+/* RFC 5061 */
+#define SCTP_SUPPORTED_CHUNK_EXT 0x8008
/*************0xC000 series*************/
#define SCTP_PRSCTP_SUPPORTED 0xc000
-/* draft-ietf-tsvwg-addip-sctp */
+/* RFC 5061 */
#define SCTP_ADD_IP_ADDRESS 0xc001
#define SCTP_DEL_IP_ADDRESS 0xc002
#define SCTP_ERROR_CAUSE_IND 0xc003
@@ -452,8 +443,8 @@ extern void getwintimeofday(struct timeval *tv);
#define SCTP_SUCCESS_REPORT 0xc005
#define SCTP_ULP_ADAPTATION 0xc006
/* behave-nat-draft */
-#define SCTP_HAS_NAT_SUPPORT 0xc007
-#define SCTP_NAT_VTAGS 0xc008
+#define SCTP_HAS_NAT_SUPPORT 0xc007
+#define SCTP_NAT_VTAGS 0xc008
/* bits for TOS field */
#define SCTP_ECT0_BIT 0x02
diff --git a/chromium/third_party/usrsctp/usrsctplib/usrsctplib/netinet/sctp_crc32.c b/chromium/third_party/usrsctp/usrsctplib/usrsctplib/netinet/sctp_crc32.c
index 16ce971c7d2..0be0795cf2a 100755
--- a/chromium/third_party/usrsctp/usrsctplib/usrsctplib/netinet/sctp_crc32.c
+++ b/chromium/third_party/usrsctp/usrsctplib/usrsctplib/netinet/sctp_crc32.c
@@ -34,18 +34,30 @@
#ifdef __FreeBSD__
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: head/sys/netinet/sctp_crc32.c 310590 2016-12-26 11:06:41Z tuexen $");
-#endif
+__FBSDID("$FreeBSD: head/sys/netinet/sctp_crc32.c 327200 2017-12-26 12:35:02Z tuexen $");
+
+#include "opt_sctp.h"
+#ifdef SCTP
#include <netinet/sctp_os.h>
#include <netinet/sctp.h>
#include <netinet/sctp_crc32.h>
#include <netinet/sctp_pcb.h>
+#else
+#include <sys/param.h>
+#include <sys/systm.h>
+#include <sys/mbuf.h>
-
-#if !defined(SCTP_WITH_NO_CSUM)
-#if defined(__FreeBSD__) && __FreeBSD_version >= 800000
+#include <netinet/sctp_crc32.h>
+#endif
#else
+#include <netinet/sctp_os.h>
+#include <netinet/sctp.h>
+#include <netinet/sctp_crc32.h>
+#include <netinet/sctp_pcb.h>
+#endif
+
+#if !defined(__FreeBSD__)
/**
*
* Routine Description:
@@ -713,8 +725,8 @@ calculate_crc32c(uint32_t crc32c,
return (multitable_crc32c(crc32c, buffer, length));
}
}
-#endif /* FreeBSD < 80000 || other OS */
+#endif
#if defined(__Userspace__)
uint32_t
#else
@@ -723,18 +735,16 @@ static uint32_t
sctp_finalize_crc32c(uint32_t crc32c)
{
uint32_t result;
-
#if BYTE_ORDER == BIG_ENDIAN
uint8_t byte0, byte1, byte2, byte3;
-
#endif
+
/* Complement the result */
result = ~crc32c;
#if BYTE_ORDER == BIG_ENDIAN
/*
- * For BIG-ENDIAN.. aka Motorola byte order the result is in
- * little-endian form. So we must manually swap the bytes. Then we
- * can call htonl() which does nothing...
+ * For BIG-ENDIAN platforms the result is in little-endian form. So we
+ * must swap the bytes to return the result in network byte order.
*/
byte0 = result & 0x000000ff;
byte1 = (result >> 8) & 0x000000ff;
@@ -743,66 +753,58 @@ sctp_finalize_crc32c(uint32_t crc32c)
crc32c = ((byte0 << 24) | (byte1 << 16) | (byte2 << 8) | byte3);
#else
/*
- * For INTEL platforms the result comes out in network order. No
- * htonl is required or the swap above. So we optimize out both the
- * htonl and the manual swap above.
+ * For LITTLE ENDIAN platforms the result is in already in network
+ * byte order.
*/
crc32c = result;
#endif
return (crc32c);
}
+/*
+ * Compute the SCTP checksum in network byte order for a given mbuf chain m
+ * which contains an SCTP packet starting at offset.
+ * Since this function is also called by ipfw, don't assume that
+ * it is compiled on a kernel with SCTP support.
+ */
uint32_t
sctp_calculate_cksum(struct mbuf *m, uint32_t offset)
{
- /*
- * given a mbuf chain with a packetheader offset by 'offset'
- * pointing at a sctphdr (with csum set to 0) go through the chain
- * of SCTP_BUF_NEXT()'s and calculate the SCTP checksum. This also
- * has a side bonus as it will calculate the total length of the
- * mbuf chain. Note: if offset is greater than the total mbuf
- * length, checksum=1, pktlen=0 is returned (ie. no real error code)
- */
uint32_t base = 0xffffffff;
- struct mbuf *at;
-
- at = m;
- /* find the correct mbuf and offset into mbuf */
- while ((at != NULL) && (offset > (uint32_t) SCTP_BUF_LEN(at))) {
- offset -= SCTP_BUF_LEN(at); /* update remaining offset
- * left */
- at = SCTP_BUF_NEXT(at);
- }
- while (at != NULL) {
- if ((SCTP_BUF_LEN(at) - offset) > 0) {
- base = calculate_crc32c(base,
- (unsigned char *)(SCTP_BUF_AT(at, offset)),
- (unsigned int)(SCTP_BUF_LEN(at) - offset));
- }
- if (offset) {
- /* we only offset once into the first mbuf */
- if (offset < (uint32_t) SCTP_BUF_LEN(at))
- offset = 0;
- else
- offset -= SCTP_BUF_LEN(at);
+
+ while (offset > 0) {
+ KASSERT(m != NULL, ("sctp_calculate_cksum, offset > length of mbuf chain"));
+ if (offset < (uint32_t)m->m_len) {
+ break;
}
- at = SCTP_BUF_NEXT(at);
+ offset -= m->m_len;
+ m = m->m_next;
+ }
+ if (offset > 0) {
+ base = calculate_crc32c(base,
+ (unsigned char *)(m->m_data + offset),
+ (unsigned int)(m->m_len - offset));
+ m = m->m_next;
+ }
+ while (m != NULL) {
+ base = calculate_crc32c(base,
+ (unsigned char *)m->m_data,
+ (unsigned int)m->m_len);
+ m = m->m_next;
}
base = sctp_finalize_crc32c(base);
return (base);
}
-#endif /* !defined(SCTP_WITH_NO_CSUM) */
-
#if defined(__FreeBSD__)
+#ifdef SCTP
+/*
+ * Compute and insert the SCTP checksum in network byte order for a given
+ * mbuf chain m which contains an SCTP packet starting at offset.
+ */
void
sctp_delayed_cksum(struct mbuf *m, uint32_t offset)
{
-#if defined(SCTP_WITH_NO_CSUM)
-#ifdef INVARIANTS
- panic("sctp_delayed_cksum() called when using no SCTP CRC.");
-#endif
-#else
uint32_t checksum;
checksum = sctp_calculate_cksum(m, offset);
@@ -810,18 +812,18 @@ sctp_delayed_cksum(struct mbuf *m, uint32_t offset)
SCTP_STAT_INCR(sctps_sendswcrc);
offset += offsetof(struct sctphdr, checksum);
- if (offset + sizeof(uint32_t) > (uint32_t) (m->m_len)) {
- SCTP_PRINTF("sctp_delayed_cksum(): m->len: %d, off: %d.\n",
- (uint32_t) m->m_len, offset);
- /*
- * XXX this shouldn't happen, but if it does, the correct
- * behavior may be to insert the checksum in the appropriate
- * next mbuf in the chain.
- */
+ if (offset + sizeof(uint32_t) > (uint32_t)(m->m_len)) {
+#ifdef INVARIANTS
+ panic("sctp_delayed_cksum(): m->m_len: %d, offset: %u.",
+ m->m_len, offset);
+#else
+ SCTP_PRINTF("sctp_delayed_cksum(): m->m_len: %d, offset: %u.\n",
+ m->m_len, offset);
+#endif
return;
}
- *(uint32_t *) (m->m_data + offset) = checksum;
-#endif
+ *(uint32_t *)(m->m_data + offset) = checksum;
}
#endif
+#endif
diff --git a/chromium/third_party/usrsctp/usrsctplib/usrsctplib/netinet/sctp_crc32.h b/chromium/third_party/usrsctp/usrsctplib/usrsctplib/netinet/sctp_crc32.h
index ee1161adbf5..ac20c10341f 100755
--- a/chromium/third_party/usrsctp/usrsctplib/usrsctplib/netinet/sctp_crc32.h
+++ b/chromium/third_party/usrsctp/usrsctplib/usrsctplib/netinet/sctp_crc32.h
@@ -34,25 +34,23 @@
#ifdef __FreeBSD__
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: head/sys/netinet/sctp_crc32.h 309607 2016-12-06 10:21:25Z tuexen $");
+__FBSDID("$FreeBSD: head/sys/netinet/sctp_crc32.h 327200 2017-12-26 12:35:02Z tuexen $");
#endif
#ifndef _NETINET_SCTP_CRC32_H_
#define _NETINET_SCTP_CRC32_H_
#if defined(_KERNEL)
-#if !defined(SCTP_WITH_NO_CSUM)
uint32_t sctp_calculate_cksum(struct mbuf *, uint32_t);
-#endif
#if defined(__FreeBSD__)
+#ifdef SCTP
void sctp_delayed_cksum(struct mbuf *, uint32_t offset);
#endif
+#endif
#endif /* _KERNEL */
#if defined(__Userspace__)
-#if !defined(SCTP_WITH_NO_CSUM)
uint32_t calculate_crc32c(uint32_t, const unsigned char *, unsigned int);
uint32_t sctp_finalize_crc32c(uint32_t);
uint32_t sctp_calculate_cksum(struct mbuf *, uint32_t);
#endif
-#endif
#endif /* __crc32c_h__ */
diff --git a/chromium/third_party/usrsctp/usrsctplib/usrsctplib/netinet/sctp_indata.c b/chromium/third_party/usrsctp/usrsctplib/usrsctplib/netinet/sctp_indata.c
index 9a1dfcb8bc0..a114707d9e1 100755
--- a/chromium/third_party/usrsctp/usrsctplib/usrsctplib/netinet/sctp_indata.c
+++ b/chromium/third_party/usrsctp/usrsctplib/usrsctplib/netinet/sctp_indata.c
@@ -34,7 +34,7 @@
#ifdef __FreeBSD__
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: head/sys/netinet/sctp_indata.c 325434 2017-11-05 11:59:33Z tuexen $");
+__FBSDID("$FreeBSD: head/sys/netinet/sctp_indata.c 328066 2018-01-16 21:58:38Z tuexen $");
#endif
#include <netinet/sctp_os.h>
@@ -3351,7 +3351,8 @@ sctp_strike_gap_ack_chunks(struct sctp_tcb *stcb, struct sctp_association *asoc,
}
}
- if (SCTP_TSN_GT(tp1->rec.data.tsn, asoc->this_sack_highest_gap)) {
+ if (SCTP_TSN_GT(tp1->rec.data.tsn, asoc->this_sack_highest_gap) &&
+ !(accum_moved && asoc->fast_retran_loss_recovery)) {
/* we are beyond the tsn in the sack */
break;
}
@@ -3375,8 +3376,10 @@ sctp_strike_gap_ack_chunks(struct sctp_tcb *stcb, struct sctp_association *asoc,
* FR using this SACK.
*/
continue;
- } else if (tp1->whoTo && SCTP_TSN_GT(tp1->rec.data.tsn,
- tp1->whoTo->this_sack_highest_newack)) {
+ } else if (tp1->whoTo &&
+ SCTP_TSN_GT(tp1->rec.data.tsn,
+ tp1->whoTo->this_sack_highest_newack) &&
+ !(accum_moved && asoc->fast_retran_loss_recovery)) {
/*
* CMT: New acks were receieved for data sent to
* this dest. But no new acks were seen for data
@@ -4597,6 +4600,14 @@ sctp_handle_sack(struct mbuf *m, int offset_seg, int offset_dup,
if (stcb->asoc.cc_functions.sctp_cwnd_prepare_net_for_sack) {
(*stcb->asoc.cc_functions.sctp_cwnd_prepare_net_for_sack)(stcb, net);
}
+
+ /*
+ * CMT: SFR algo (and HTNA) - this_sack_highest_newack has
+ * to be greater than the cumack. Also reset saw_newack to 0
+ * for all dests.
+ */
+ net->saw_newack = 0;
+ net->this_sack_highest_newack = last_tsn;
}
/* process the new consecutive TSN first */
TAILQ_FOREACH(tp1, &asoc->sent_queue, sctp_next) {
@@ -4724,16 +4735,6 @@ sctp_handle_sack(struct mbuf *m, int offset_seg, int offset_dup,
if ((num_seg > 0) || (num_nr_seg > 0)) {
/*
- * CMT: SFR algo (and HTNA) - this_sack_highest_newack has
- * to be greater than the cumack. Also reset saw_newack to 0
- * for all dests.
- */
- TAILQ_FOREACH(net, &asoc->nets, sctp_next) {
- net->saw_newack = 0;
- net->this_sack_highest_newack = last_tsn;
- }
-
- /*
* thisSackHighestGap will increase while handling NEW
* segments this_sack_highest_newack will increase while
* handling NEWLY ACKED chunks. this_sack_lowest_newack is
diff --git a/chromium/third_party/usrsctp/usrsctplib/usrsctplib/netinet/sctp_input.c b/chromium/third_party/usrsctp/usrsctplib/usrsctplib/netinet/sctp_input.c
index d2ceb75ffe1..5d7077656bf 100755
--- a/chromium/third_party/usrsctp/usrsctplib/usrsctplib/netinet/sctp_input.c
+++ b/chromium/third_party/usrsctp/usrsctplib/usrsctplib/netinet/sctp_input.c
@@ -34,7 +34,7 @@
#ifdef __FreeBSD__
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: head/sys/netinet/sctp_input.c 325864 2017-11-15 22:13:10Z tuexen $");
+__FBSDID("$FreeBSD: head/sys/netinet/sctp_input.c 326829 2017-12-13 17:11:57Z tuexen $");
#endif
#include <netinet/sctp_os.h>
@@ -3396,9 +3396,9 @@ sctp_handle_ecn_cwr(struct sctp_cwr_chunk *cp, struct sctp_tcb *stcb, struct sct
stcb->asoc.ecn_echo_cnt_onq--;
TAILQ_REMOVE(&stcb->asoc.control_send_queue, chk,
sctp_next);
+ stcb->asoc.ctrl_queue_cnt--;
sctp_m_freem(chk->data);
chk->data = NULL;
- stcb->asoc.ctrl_queue_cnt--;
sctp_free_a_chunk(stcb, chk, SCTP_SO_NOT_LOCKED);
if (override == 0) {
break;
@@ -3827,26 +3827,23 @@ static void
sctp_clean_up_stream_reset(struct sctp_tcb *stcb)
{
struct sctp_association *asoc;
- struct sctp_tmit_chunk *chk = stcb->asoc.str_reset;
+ struct sctp_tmit_chunk *chk;
- if (stcb->asoc.str_reset == NULL) {
+ asoc = &stcb->asoc;
+ chk = asoc->str_reset;
+ if (chk == NULL) {
return;
}
- asoc = &stcb->asoc;
-
+ asoc->str_reset = NULL;
sctp_timer_stop(SCTP_TIMER_TYPE_STRRESET, stcb->sctp_ep, stcb,
chk->whoTo, SCTP_FROM_SCTP_INPUT + SCTP_LOC_28);
- TAILQ_REMOVE(&asoc->control_send_queue,
- chk,
- sctp_next);
+ TAILQ_REMOVE(&asoc->control_send_queue, chk, sctp_next);
+ asoc->ctrl_queue_cnt--;
if (chk->data) {
sctp_m_freem(chk->data);
chk->data = NULL;
}
- asoc->ctrl_queue_cnt--;
sctp_free_a_chunk(stcb, chk, SCTP_SO_NOT_LOCKED);
- /*sa_ignore NO_NULL_CHK*/
- stcb->asoc.str_reset = NULL;
}
@@ -5719,9 +5716,7 @@ void
sctp_common_input_processing(struct mbuf **mm, int iphlen, int offset, int length,
struct sockaddr *src, struct sockaddr *dst,
struct sctphdr *sh, struct sctp_chunkhdr *ch,
-#if !defined(SCTP_WITH_NO_CSUM)
uint8_t compute_crc,
-#endif
uint8_t ecn_bits,
#if defined(__FreeBSD__)
uint8_t mflowtype, uint32_t mflowid, uint16_t fibnum,
@@ -5743,7 +5738,6 @@ sctp_common_input_processing(struct mbuf **mm, int iphlen, int offset, int lengt
sctp_audit_log(0xE0, 1);
sctp_auditing(0, inp, stcb, net);
#endif
-#if !defined(SCTP_WITH_NO_CSUM)
if (compute_crc != 0) {
uint32_t check, calc_check;
@@ -5790,7 +5784,6 @@ sctp_common_input_processing(struct mbuf **mm, int iphlen, int offset, int lengt
goto out;
}
}
-#endif
/* Destination port of 0 is illegal, based on RFC4960. */
if (sh->dest_port == 0) {
SCTP_STAT_INCR(sctps_hdrops);
@@ -6141,9 +6134,7 @@ sctp_input(i_pak, va_alist)
struct sctphdr *sh;
struct sctp_chunkhdr *ch;
int length, offset;
-#if !defined(SCTP_WITH_NO_CSUM)
uint8_t compute_crc;
-#endif
#if defined(__FreeBSD__)
uint32_t mflowid;
uint8_t mflowtype;
@@ -6286,9 +6277,6 @@ sctp_input(i_pak, va_alist)
goto out;
}
ecn_bits = ip->ip_tos;
-#if defined(SCTP_WITH_NO_CSUM)
- SCTP_STAT_INCR(sctps_recvnocrc);
-#else
#if defined(__FreeBSD__) && __FreeBSD_version >= 800000
if (m->m_pkthdr.csum_flags & CSUM_SCTP_VALID) {
SCTP_STAT_INCR(sctps_recvhwcrc);
@@ -6298,21 +6286,18 @@ sctp_input(i_pak, va_alist)
if (SCTP_BASE_SYSCTL(sctp_no_csum_on_loopback) &&
((src.sin_addr.s_addr == dst.sin_addr.s_addr) ||
(SCTP_IS_IT_LOOPBACK(m)))) {
- SCTP_STAT_INCR(sctps_recvnocrc);
+ SCTP_STAT_INCR(sctps_recvhwcrc);
compute_crc = 0;
} else {
#endif
SCTP_STAT_INCR(sctps_recvswcrc);
compute_crc = 1;
}
-#endif
sctp_common_input_processing(&m, iphlen, offset, length,
(struct sockaddr *)&src,
(struct sockaddr *)&dst,
sh, ch,
-#if !defined(SCTP_WITH_NO_CSUM)
compute_crc,
-#endif
ecn_bits,
#if defined(__FreeBSD__)
mflowtype, mflowid, fibnum,
diff --git a/chromium/third_party/usrsctp/usrsctplib/usrsctplib/netinet/sctp_input.h b/chromium/third_party/usrsctp/usrsctplib/usrsctplib/netinet/sctp_input.h
index c92c8bd9b26..2d01beb08de 100755
--- a/chromium/third_party/usrsctp/usrsctplib/usrsctplib/netinet/sctp_input.h
+++ b/chromium/third_party/usrsctp/usrsctplib/usrsctplib/netinet/sctp_input.h
@@ -34,7 +34,7 @@
#ifdef __FreeBSD__
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: head/sys/netinet/sctp_input.h 310590 2016-12-26 11:06:41Z tuexen $");
+__FBSDID("$FreeBSD: head/sys/netinet/sctp_input.h 326672 2017-12-07 22:19:08Z tuexen $");
#endif
#ifndef _NETINET_SCTP_INPUT_H_
@@ -45,9 +45,7 @@ void
sctp_common_input_processing(struct mbuf **, int, int, int,
struct sockaddr *, struct sockaddr *,
struct sctphdr *, struct sctp_chunkhdr *,
-#if !defined(SCTP_WITH_NO_CSUM)
uint8_t,
-#endif
uint8_t,
#if defined(__FreeBSD__)
uint8_t, uint32_t, uint16_t,
diff --git a/chromium/third_party/usrsctp/usrsctplib/usrsctplib/netinet/sctp_output.c b/chromium/third_party/usrsctp/usrsctplib/usrsctplib/netinet/sctp_output.c
index 6ac2059b358..c7afc9f7040 100755
--- a/chromium/third_party/usrsctp/usrsctplib/usrsctplib/netinet/sctp_output.c
+++ b/chromium/third_party/usrsctp/usrsctplib/usrsctplib/netinet/sctp_output.c
@@ -34,7 +34,7 @@
#ifdef __FreeBSD__
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: head/sys/netinet/sctp_output.c 325370 2017-11-03 20:46:12Z tuexen $");
+__FBSDID("$FreeBSD: head/sys/netinet/sctp_output.c 326829 2017-12-13 17:11:57Z tuexen $");
#endif
#include <netinet/sctp_os.h>
@@ -4410,12 +4410,8 @@ sctp_lowlevel_chunk_output(struct sctp_inpcb *inp,
}
SCTP_ATTACH_CHAIN(o_pak, m, packet_length);
if (port) {
-#if defined(SCTP_WITH_NO_CSUM)
- SCTP_STAT_INCR(sctps_sendnocrc);
-#else
sctphdr->checksum = sctp_calculate_cksum(m, sizeof(struct ip) + sizeof(struct udphdr));
SCTP_STAT_INCR(sctps_sendswcrc);
-#endif
#if !defined(__Windows__) && !defined(__Userspace__)
#if defined(__FreeBSD__) && ((__FreeBSD_version > 803000 && __FreeBSD_version < 900000) || __FreeBSD_version > 900000)
if (V_udp_cksum) {
@@ -4426,9 +4422,6 @@ sctp_lowlevel_chunk_output(struct sctp_inpcb *inp,
#endif
#endif
} else {
-#if defined(SCTP_WITH_NO_CSUM)
- SCTP_STAT_INCR(sctps_sendnocrc);
-#else
#if defined(__FreeBSD__) && __FreeBSD_version >= 800000
m->m_pkthdr.csum_flags = CSUM_SCTP;
m->m_pkthdr.csum_data = offsetof(struct sctphdr, checksum);
@@ -4439,10 +4432,9 @@ sctp_lowlevel_chunk_output(struct sctp_inpcb *inp,
sctphdr->checksum = sctp_calculate_cksum(m, sizeof(struct ip));
SCTP_STAT_INCR(sctps_sendswcrc);
} else {
- SCTP_STAT_INCR(sctps_sendnocrc);
+ SCTP_STAT_INCR(sctps_sendhwcrc);
}
#endif
-#endif
}
#ifdef SCTP_PACKET_LOGGING
if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_LAST_PACKET_TRACING)
@@ -4854,12 +4846,8 @@ sctp_lowlevel_chunk_output(struct sctp_inpcb *inp,
}
SCTP_ATTACH_CHAIN(o_pak, m, packet_length);
if (port) {
-#if defined(SCTP_WITH_NO_CSUM)
- SCTP_STAT_INCR(sctps_sendnocrc);
-#else
sctphdr->checksum = sctp_calculate_cksum(m, sizeof(struct ip6_hdr) + sizeof(struct udphdr));
SCTP_STAT_INCR(sctps_sendswcrc);
-#endif
#if defined(__Windows__)
udp->uh_sum = 0;
#elif !defined(__Userspace__)
@@ -4868,9 +4856,6 @@ sctp_lowlevel_chunk_output(struct sctp_inpcb *inp,
}
#endif
} else {
-#if defined(SCTP_WITH_NO_CSUM)
- SCTP_STAT_INCR(sctps_sendnocrc);
-#else
#if defined(__FreeBSD__) && __FreeBSD_version >= 800000
#if __FreeBSD_version < 900000
sctphdr->checksum = sctp_calculate_cksum(m, sizeof(struct ip6_hdr));
@@ -4890,10 +4875,9 @@ sctp_lowlevel_chunk_output(struct sctp_inpcb *inp,
sctphdr->checksum = sctp_calculate_cksum(m, sizeof(struct ip6_hdr));
SCTP_STAT_INCR(sctps_sendswcrc);
} else {
- SCTP_STAT_INCR(sctps_sendnocrc);
+ SCTP_STAT_INCR(sctps_sendhwcrc);
}
#endif
-#endif
}
/* send it out. table id is taken from stcb */
#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING)
@@ -5010,16 +4994,12 @@ sctp_lowlevel_chunk_output(struct sctp_inpcb *inp,
sctphdr->dest_port = dest_port;
sctphdr->v_tag = v_tag;
sctphdr->checksum = 0;
-#if defined(SCTP_WITH_NO_CSUM)
- SCTP_STAT_INCR(sctps_sendnocrc);
-#else
if (SCTP_BASE_VAR(crc32c_offloaded) == 0) {
sctphdr->checksum = sctp_calculate_cksum(m, 0);
SCTP_STAT_INCR(sctps_sendswcrc);
} else {
SCTP_STAT_INCR(sctps_sendhwcrc);
}
-#endif
if (tos_value == 0) {
tos_value = inp->ip_inp.inp.inp_ip_tos;
}
@@ -7425,11 +7405,11 @@ sctp_toss_old_cookies(struct sctp_tcb *stcb, struct sctp_association *asoc)
TAILQ_FOREACH_SAFE(chk, &asoc->control_send_queue, sctp_next, nchk) {
if (chk->rec.chunk_id.id == SCTP_COOKIE_ECHO) {
TAILQ_REMOVE(&asoc->control_send_queue, chk, sctp_next);
+ asoc->ctrl_queue_cnt--;
if (chk->data) {
sctp_m_freem(chk->data);
chk->data = NULL;
}
- asoc->ctrl_queue_cnt--;
sctp_free_a_chunk(stcb, chk, SCTP_SO_NOT_LOCKED);
}
}
@@ -7454,11 +7434,11 @@ sctp_toss_old_asconf(struct sctp_tcb *stcb)
}
}
TAILQ_REMOVE(&asoc->asconf_send_queue, chk, sctp_next);
+ asoc->ctrl_queue_cnt--;
if (chk->data) {
sctp_m_freem(chk->data);
chk->data = NULL;
}
- asoc->ctrl_queue_cnt--;
sctp_free_a_chunk(stcb, chk, SCTP_SO_NOT_LOCKED);
}
}
@@ -7582,13 +7562,14 @@ sctp_clean_up_ctl(struct sctp_tcb *stcb, struct sctp_association *asoc, int so_l
/* Stray chunks must be cleaned up */
clean_up_anyway:
TAILQ_REMOVE(&asoc->control_send_queue, chk, sctp_next);
+ asoc->ctrl_queue_cnt--;
if (chk->data) {
sctp_m_freem(chk->data);
chk->data = NULL;
}
- asoc->ctrl_queue_cnt--;
- if (chk->rec.chunk_id.id == SCTP_FORWARD_CUM_TSN)
+ if (chk->rec.chunk_id.id == SCTP_FORWARD_CUM_TSN) {
asoc->fwd_tsn_cnt--;
+ }
sctp_free_a_chunk(stcb, chk, so_locked);
} else if (chk->rec.chunk_id.id == SCTP_STREAM_RESET) {
/* special handling, we must look into the param */
@@ -11879,12 +11860,8 @@ sctp_send_resp_msg(struct sockaddr *src, struct sockaddr *dst,
ip->ip_len = htons(len);
#endif
if (port) {
-#if defined(SCTP_WITH_NO_CSUM)
- SCTP_STAT_INCR(sctps_sendnocrc);
-#else
shout->checksum = sctp_calculate_cksum(mout, sizeof(struct ip) + sizeof(struct udphdr));
SCTP_STAT_INCR(sctps_sendswcrc);
-#endif
#if !defined(__Windows__) && !defined(__Userspace__)
#if defined(__FreeBSD__) && ((__FreeBSD_version > 803000 && __FreeBSD_version < 900000) || __FreeBSD_version > 900000)
if (V_udp_cksum) {
@@ -11895,9 +11872,6 @@ sctp_send_resp_msg(struct sockaddr *src, struct sockaddr *dst,
#endif
#endif
} else {
-#if defined(SCTP_WITH_NO_CSUM)
- SCTP_STAT_INCR(sctps_sendnocrc);
-#else
#if defined(__FreeBSD__) && __FreeBSD_version >= 800000
mout->m_pkthdr.csum_flags = CSUM_SCTP;
mout->m_pkthdr.csum_data = offsetof(struct sctphdr, checksum);
@@ -11906,7 +11880,6 @@ sctp_send_resp_msg(struct sockaddr *src, struct sockaddr *dst,
shout->checksum = sctp_calculate_cksum(mout, sizeof(struct ip));
SCTP_STAT_INCR(sctps_sendswcrc);
#endif
-#endif
}
#ifdef SCTP_PACKET_LOGGING
if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_LAST_PACKET_TRACING) {
@@ -11929,12 +11902,8 @@ sctp_send_resp_msg(struct sockaddr *src, struct sockaddr *dst,
case AF_INET6:
ip6->ip6_plen = (uint16_t)(len - sizeof(struct ip6_hdr));
if (port) {
-#if defined(SCTP_WITH_NO_CSUM)
- SCTP_STAT_INCR(sctps_sendnocrc);
-#else
shout->checksum = sctp_calculate_cksum(mout, sizeof(struct ip6_hdr) + sizeof(struct udphdr));
SCTP_STAT_INCR(sctps_sendswcrc);
-#endif
#if defined(__Windows__)
udp->uh_sum = 0;
#elif !defined(__Userspace__)
@@ -11943,9 +11912,6 @@ sctp_send_resp_msg(struct sockaddr *src, struct sockaddr *dst,
}
#endif
} else {
-#if defined(SCTP_WITH_NO_CSUM)
- SCTP_STAT_INCR(sctps_sendnocrc);
-#else
#if defined(__FreeBSD__) && __FreeBSD_version >= 900000
#if __FreeBSD_version > 901000
mout->m_pkthdr.csum_flags = CSUM_SCTP_IPV6;
@@ -11958,7 +11924,6 @@ sctp_send_resp_msg(struct sockaddr *src, struct sockaddr *dst,
shout->checksum = sctp_calculate_cksum(mout, sizeof(struct ip6_hdr));
SCTP_STAT_INCR(sctps_sendswcrc);
#endif
-#endif
}
#ifdef SCTP_PACKET_LOGGING
if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_LAST_PACKET_TRACING) {
@@ -11975,16 +11940,12 @@ sctp_send_resp_msg(struct sockaddr *src, struct sockaddr *dst,
struct sockaddr_conn *sconn;
sconn = (struct sockaddr_conn *)src;
-#if defined(SCTP_WITH_NO_CSUM)
- SCTP_STAT_INCR(sctps_sendnocrc);
-#else
if (SCTP_BASE_VAR(crc32c_offloaded) == 0) {
shout->checksum = sctp_calculate_cksum(mout, 0);
SCTP_STAT_INCR(sctps_sendswcrc);
} else {
SCTP_STAT_INCR(sctps_sendhwcrc);
}
-#endif
#ifdef SCTP_PACKET_LOGGING
if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_LAST_PACKET_TRACING) {
sctp_packet_log(mout);
diff --git a/chromium/third_party/usrsctp/usrsctplib/usrsctplib/netinet/sctp_pcb.h b/chromium/third_party/usrsctp/usrsctplib/usrsctplib/netinet/sctp_pcb.h
index 47aaa24a2f4..34881863ffa 100755
--- a/chromium/third_party/usrsctp/usrsctplib/usrsctplib/netinet/sctp_pcb.h
+++ b/chromium/third_party/usrsctp/usrsctplib/usrsctplib/netinet/sctp_pcb.h
@@ -311,7 +311,7 @@ struct sctp_base_info {
#if defined(__Userspace__)
userland_mutex_t timer_mtx;
userland_thread_t timer_thread;
- uint8_t timer_thread_should_exit;
+ int timer_thread_should_exit;
#if !defined(__Userspace_os_Windows)
pthread_mutexattr_t mtx_attr;
#if defined(INET) || defined(INET6)
diff --git a/chromium/third_party/usrsctp/usrsctplib/usrsctplib/netinet/sctp_structs.h b/chromium/third_party/usrsctp/usrsctplib/usrsctplib/netinet/sctp_structs.h
index 543d386663a..f49f2c87a77 100755
--- a/chromium/third_party/usrsctp/usrsctplib/usrsctplib/netinet/sctp_structs.h
+++ b/chromium/third_party/usrsctp/usrsctplib/usrsctplib/netinet/sctp_structs.h
@@ -250,6 +250,9 @@ struct sctp_net_route {
#endif
#endif
#if defined(__APPLE__)
+#if !defined(APPLE_LEOPARD) && !defined(APPLE_SNOWLEOPARD) && !defined(APPLE_LION) && !defined(APPLE_MOUNTAINLION) && !defined(APPLE_ELCAPITAN)
+ struct llentry *ro_lle;
+#endif
#if !defined(APPLE_LEOPARD) && !defined(APPLE_SNOWLEOPARD) && !defined(APPLE_LION) && !defined(APPLE_MOUNTAINLION)
struct ifaddr *ro_srcia;
#endif
diff --git a/chromium/third_party/usrsctp/usrsctplib/usrsctplib/netinet/sctp_sysctl.c b/chromium/third_party/usrsctp/usrsctplib/usrsctplib/netinet/sctp_sysctl.c
index 59b22e401cd..1898ab58ac8 100755
--- a/chromium/third_party/usrsctp/usrsctplib/usrsctplib/netinet/sctp_sysctl.c
+++ b/chromium/third_party/usrsctp/usrsctplib/usrsctplib/netinet/sctp_sysctl.c
@@ -34,7 +34,7 @@
#ifdef __FreeBSD__
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: head/sys/netinet/sctp_sysctl.c 323505 2017-09-12 21:08:50Z tuexen $");
+__FBSDID("$FreeBSD: head/sys/netinet/sctp_sysctl.c 326672 2017-12-07 22:19:08Z tuexen $");
#endif
#include <netinet/sctp_os.h>
@@ -75,10 +75,8 @@ sctp_init_sysctls()
SCTP_BASE_SYSCTL(sctp_nrsack_enable) = SCTPCTL_NRSACK_ENABLE_DEFAULT;
SCTP_BASE_SYSCTL(sctp_pktdrop_enable) = SCTPCTL_PKTDROP_ENABLE_DEFAULT;
#if !(defined(__FreeBSD__) && __FreeBSD_version >= 800000)
-#if !defined(SCTP_WITH_NO_CSUM)
SCTP_BASE_SYSCTL(sctp_no_csum_on_loopback) = SCTPCTL_LOOPBACK_NOCSUM_DEFAULT;
#endif
-#endif
SCTP_BASE_SYSCTL(sctp_peer_chunk_oh) = SCTPCTL_PEER_CHKOH_DEFAULT;
SCTP_BASE_SYSCTL(sctp_max_burst_default) = SCTPCTL_MAXBURST_DEFAULT;
SCTP_BASE_SYSCTL(sctp_fr_max_burst_default) = SCTPCTL_FRMAXBURST_DEFAULT;
@@ -962,7 +960,6 @@ sctp_sysctl_handle_stats(SYSCTL_HANDLER_ARGS)
sb.sctps_recvauthfailed += sarry->sctps_recvauthfailed;
sb.sctps_recvexpress += sarry->sctps_recvexpress;
sb.sctps_recvexpressm += sarry->sctps_recvexpressm;
- sb.sctps_recvnocrc += sarry->sctps_recvnocrc;
sb.sctps_recvswcrc += sarry->sctps_recvswcrc;
sb.sctps_recvhwcrc += sarry->sctps_recvhwcrc;
sb.sctps_sendpackets += sarry->sctps_sendpackets;
@@ -975,7 +972,6 @@ sctp_sysctl_handle_stats(SYSCTL_HANDLER_ARGS)
sb.sctps_sendecne += sarry->sctps_sendecne;
sb.sctps_sendauth += sarry->sctps_sendauth;
sb.sctps_senderrors += sarry->sctps_senderrors;
- sb.sctps_sendnocrc += sarry->sctps_sendnocrc;
sb.sctps_sendswcrc += sarry->sctps_sendswcrc;
sb.sctps_sendhwcrc += sarry->sctps_sendhwcrc;
sb.sctps_pdrpfmbox += sarry->sctps_pdrpfmbox;
@@ -1239,10 +1235,8 @@ SCTP_UINT_SYSCTL(reconfig_enable, sctp_reconfig_enable, SCTPCTL_RECONFIG_ENABLE)
SCTP_UINT_SYSCTL(nrsack_enable, sctp_nrsack_enable, SCTPCTL_NRSACK_ENABLE)
SCTP_UINT_SYSCTL(pktdrop_enable, sctp_pktdrop_enable, SCTPCTL_PKTDROP_ENABLE)
#if defined(__APPLE__)
-#if !defined(SCTP_WITH_NO_CSUM)
SCTP_UINT_SYSCTL(loopback_nocsum, sctp_no_csum_on_loopback, SCTPCTL_LOOPBACK_NOCSUM)
#endif
-#endif
SCTP_UINT_SYSCTL(peer_chkoh, sctp_peer_chunk_oh, SCTPCTL_PEER_CHKOH)
SCTP_UINT_SYSCTL(maxburst, sctp_max_burst_default, SCTPCTL_MAXBURST)
SCTP_UINT_SYSCTL(fr_maxburst, sctp_fr_max_burst_default, SCTPCTL_FRMAXBURST)
@@ -1348,9 +1342,7 @@ sctp_sysctl_handle_int(SYSCTL_HANDLER_ARGS)
RANGECHK(SCTP_BASE_SYSCTL(sctp_reconfig_enable), SCTPCTL_RECONFIG_ENABLE_MIN, SCTPCTL_RECONFIG_ENABLE_MAX);
RANGECHK(SCTP_BASE_SYSCTL(sctp_nrsack_enable), SCTPCTL_NRSACK_ENABLE_MIN, SCTPCTL_NRSACK_ENABLE_MAX);
RANGECHK(SCTP_BASE_SYSCTL(sctp_pktdrop_enable), SCTPCTL_PKTDROP_ENABLE_MIN, SCTPCTL_PKTDROP_ENABLE_MAX);
-#if !defined(SCTP_WITH_NO_CSUM)
RANGECHK(SCTP_BASE_SYSCTL(sctp_no_csum_on_loopback), SCTPCTL_LOOPBACK_NOCSUM_MIN, SCTPCTL_LOOPBACK_NOCSUM_MAX);
-#endif
RANGECHK(SCTP_BASE_SYSCTL(sctp_peer_chunk_oh), SCTPCTL_PEER_CHKOH_MIN, SCTPCTL_PEER_CHKOH_MAX);
RANGECHK(SCTP_BASE_SYSCTL(sctp_max_burst_default), SCTPCTL_MAXBURST_MIN, SCTPCTL_MAXBURST_MAX);
RANGECHK(SCTP_BASE_SYSCTL(sctp_fr_max_burst_default), SCTPCTL_FRMAXBURST_MIN, SCTPCTL_FRMAXBURST_MAX);
@@ -1458,11 +1450,9 @@ sysctl_setup_sctp(void)
&SCTP_BASE_SYSCTL(sctp_pktdrop_enable), 0, sctp_sysctl_handle_int,
SCTPCTL_PKTDROP_ENABLE_DESC);
-#if !defined(SCTP_WITH_NO_CSUM)
sysctl_add_oid(&sysctl_oid_top, "loopback_nocsum", CTLTYPE_INT|CTLFLAG_RW,
&SCTP_BASE_SYSCTL(sctp_no_csum_on_loopback), 0, sctp_sysctl_handle_int,
SCTPCTL_LOOPBACK_NOCSUM_DESC);
-#endif
sysctl_add_oid(&sysctl_oid_top, "peer_chkoh", CTLTYPE_INT|CTLFLAG_RW,
&SCTP_BASE_SYSCTL(sctp_peer_chunk_oh), 0, sctp_sysctl_handle_int,
diff --git a/chromium/third_party/usrsctp/usrsctplib/usrsctplib/netinet/sctp_sysctl.h b/chromium/third_party/usrsctp/usrsctplib/usrsctplib/netinet/sctp_sysctl.h
index 22ae57e7e7d..4f10ff67691 100755
--- a/chromium/third_party/usrsctp/usrsctplib/usrsctplib/netinet/sctp_sysctl.h
+++ b/chromium/third_party/usrsctp/usrsctplib/usrsctplib/netinet/sctp_sysctl.h
@@ -57,10 +57,8 @@ struct sctp_sysctl {
uint32_t sctp_pktdrop_enable;
uint32_t sctp_fr_max_burst_default;
#if !(defined(__FreeBSD__) && __FreeBSD_version >= 800000)
-#if !defined(SCTP_WITH_NO_CSUM)
uint32_t sctp_no_csum_on_loopback;
#endif
-#endif
uint32_t sctp_peer_chunk_oh;
uint32_t sctp_max_burst_default;
uint32_t sctp_max_chunks_on_queue;
diff --git a/chromium/third_party/usrsctp/usrsctplib/usrsctplib/netinet/sctp_uio.h b/chromium/third_party/usrsctp/usrsctplib/usrsctplib/netinet/sctp_uio.h
index 956d754eaac..9d31aa1590a 100755
--- a/chromium/third_party/usrsctp/usrsctplib/usrsctplib/netinet/sctp_uio.h
+++ b/chromium/third_party/usrsctp/usrsctplib/usrsctplib/netinet/sctp_uio.h
@@ -34,7 +34,7 @@
#ifdef __FreeBSD__
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: head/sys/netinet/sctp_uio.h 323505 2017-09-12 21:08:50Z tuexen $");
+__FBSDID("$FreeBSD: head/sys/netinet/sctp_uio.h 326672 2017-12-07 22:19:08Z tuexen $");
#endif
#ifndef _NETINET_SCTP_UIO_H_
@@ -1012,7 +1012,7 @@ struct sctpstat {
uint32_t sctps_recvauthfailed; /* total number of auth failed */
uint32_t sctps_recvexpress; /* total fast path receives all one chunk */
uint32_t sctps_recvexpressm; /* total fast path multi-part data */
- uint32_t sctps_recvnocrc;
+ uint32_t sctps_recv_spare; /* formerly sctps_recvnocrc */
uint32_t sctps_recvswcrc;
uint32_t sctps_recvhwcrc;
@@ -1023,13 +1023,13 @@ struct sctpstat {
uint32_t sctps_sendretransdata; /* total output retransmitted DATA chunks */
uint32_t sctps_sendfastretrans; /* total output fast retransmitted DATA chunks */
uint32_t sctps_sendmultfastretrans; /* total FR's that happened more than once
- * to same chunk (u-del multi-fr algo).
- */
+ * to same chunk (u-del multi-fr algo).
+ */
uint32_t sctps_sendheartbeat; /* total output HB chunks */
uint32_t sctps_sendecne; /* total output ECNE chunks */
uint32_t sctps_sendauth; /* total output AUTH chunks FIXME */
- uint32_t sctps_senderrors; /* ip_output error counter */
- uint32_t sctps_sendnocrc;
+ uint32_t sctps_senderrors; /* ip_output error counter */
+ uint32_t sctps_send_spare; /* formerly sctps_sendnocrc */
uint32_t sctps_sendswcrc;
uint32_t sctps_sendhwcrc;
/* PCKDROPREP statistics: */
diff --git a/chromium/third_party/usrsctp/usrsctplib/usrsctplib/netinet/sctp_usrreq.c b/chromium/third_party/usrsctp/usrsctplib/usrsctplib/netinet/sctp_usrreq.c
index 0325571469d..32aea676689 100755
--- a/chromium/third_party/usrsctp/usrsctplib/usrsctplib/netinet/sctp_usrreq.c
+++ b/chromium/third_party/usrsctp/usrsctplib/usrsctplib/netinet/sctp_usrreq.c
@@ -233,7 +233,7 @@ sctp_finish(void)
#endif
}
#endif
- SCTP_BASE_VAR(timer_thread_should_exit) = 1;
+ atomic_cmpset_int(&SCTP_BASE_VAR(timer_thread_should_exit), 0, 1);
#if defined(__Userspace_os_Windows)
WaitForSingleObject(SCTP_BASE_VAR(timer_thread), INFINITE);
CloseHandle(SCTP_BASE_VAR(timer_thread));
@@ -415,7 +415,11 @@ void
#else
void *
#endif
+#if defined(__APPLE__) && !defined(APPLE_LEOPARD) && !defined(APPLE_SNOWLEOPARD) && !defined(APPLE_LION) && !defined(APPLE_MOUNTAINLION) && !defined(APPLE_ELCAPITAN)
+sctp_ctlinput(int cmd, struct sockaddr *sa, void *vip, struct ifnet *ifp SCTP_UNUSED)
+#else
sctp_ctlinput(int cmd, struct sockaddr *sa, void *vip)
+#endif
{
#if defined(__FreeBSD__)
struct ip *outer_ip;
diff --git a/chromium/third_party/usrsctp/usrsctplib/usrsctplib/netinet/sctp_var.h b/chromium/third_party/usrsctp/usrsctplib/usrsctplib/netinet/sctp_var.h
index 860eceb628e..bc4afe95f1f 100755
--- a/chromium/third_party/usrsctp/usrsctplib/usrsctplib/netinet/sctp_var.h
+++ b/chromium/third_party/usrsctp/usrsctplib/usrsctplib/netinet/sctp_var.h
@@ -419,7 +419,11 @@ void sctp_input __P((struct mbuf *, int));
#endif
void sctp_pathmtu_adjustment __P((struct sctp_tcb *, uint16_t));
#else
+#if defined(__APPLE__) && !defined(APPLE_LEOPARD) && !defined(APPLE_SNOWLEOPARD) && !defined(APPLE_LION) && !defined(APPLE_MOUNTAINLION) && !defined(APPLE_ELCAPITAN)
+void sctp_ctlinput(int, struct sockaddr *, void *, struct ifnet * SCTP_UNUSED);
+#else
void sctp_ctlinput(int, struct sockaddr *, void *);
+#endif
int sctp_ctloutput(struct socket *, struct sockopt *);
#ifdef INET
void sctp_input_with_port(struct mbuf *, int, uint16_t);
diff --git a/chromium/third_party/usrsctp/usrsctplib/usrsctplib/netinet/sctputil.c b/chromium/third_party/usrsctp/usrsctplib/usrsctplib/netinet/sctputil.c
index 2e404eb7345..567d8e0fb36 100755
--- a/chromium/third_party/usrsctp/usrsctplib/usrsctplib/netinet/sctputil.c
+++ b/chromium/third_party/usrsctp/usrsctplib/usrsctplib/netinet/sctputil.c
@@ -34,7 +34,7 @@
#ifdef __FreeBSD__
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: head/sys/netinet/sctputil.c 326163 2017-11-24 12:18:48Z tuexen $");
+__FBSDID("$FreeBSD: head/sys/netinet/sctputil.c 328028 2018-01-15 21:59:20Z tuexen $");
#endif
#include <netinet/sctp_os.h>
@@ -51,7 +51,7 @@ __FBSDID("$FreeBSD: head/sys/netinet/sctputil.c 326163 2017-11-24 12:18:48Z tuex
#include <netinet/sctp_output.h>
#include <netinet/sctp_uio.h>
#include <netinet/sctp_timer.h>
-#include <netinet/sctp_indata.h>/* for sctp_deliver_data() */
+#include <netinet/sctp_indata.h>
#include <netinet/sctp_auth.h>
#include <netinet/sctp_asconf.h>
#include <netinet/sctp_bsd_addr.h>
@@ -6693,7 +6693,8 @@ sctp_m_free(struct mbuf *m)
return (m_free(m));
}
-void sctp_m_freem(struct mbuf *mb)
+void
+sctp_m_freem(struct mbuf *mb)
{
while (mb != NULL)
mb = sctp_m_free(mb);
@@ -6764,6 +6765,7 @@ sctp_soreceive( struct socket *so,
struct sockaddr *from;
struct sctp_extrcvinfo sinfo;
int filling_sinfo = 1;
+ int flags;
struct sctp_inpcb *inp;
inp = (struct sctp_inpcb *)so->so_pcb;
@@ -6796,15 +6798,24 @@ sctp_soreceive( struct socket *so,
if (filling_sinfo) {
memset(&sinfo, 0, sizeof(struct sctp_extrcvinfo));
}
- error = sctp_sorecvmsg(so, uio, mp0, from, fromlen, flagsp,
+ if (flagsp != NULL) {
+ flags = *flagsp;
+ } else {
+ flags = 0;
+ }
+ error = sctp_sorecvmsg(so, uio, mp0, from, fromlen, &flags,
(struct sctp_sndrcvinfo *)&sinfo, filling_sinfo);
+ if (flagsp != NULL) {
+ *flagsp = flags;
+ }
if (controlp != NULL) {
/* copy back the sinfo in a CMSG format */
- if (filling_sinfo)
+ if (filling_sinfo && ((flags & MSG_NOTIFICATION) == 0)) {
*controlp = sctp_build_ctl_nchunk(inp,
(struct sctp_sndrcvinfo *)&sinfo);
- else
+ } else {
*controlp = NULL;
+ }
}
if (psa) {
/* copy back the address info */
diff --git a/chromium/third_party/usrsctp/usrsctplib/usrsctplib/netinet6/sctp6_usrreq.c b/chromium/third_party/usrsctp/usrsctplib/usrsctplib/netinet6/sctp6_usrreq.c
index 752f52bc608..07ed304ab1e 100644
--- a/chromium/third_party/usrsctp/usrsctplib/usrsctplib/netinet6/sctp6_usrreq.c
+++ b/chromium/third_party/usrsctp/usrsctplib/usrsctplib/netinet6/sctp6_usrreq.c
@@ -34,7 +34,7 @@
#ifdef __FreeBSD__
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: head/sys/netinet6/sctp6_usrreq.c 325370 2017-11-03 20:46:12Z tuexen $");
+__FBSDID("$FreeBSD: head/sys/netinet6/sctp6_usrreq.c 326672 2017-12-07 22:19:08Z tuexen $");
#endif
#include <netinet/sctp_os.h>
@@ -151,9 +151,7 @@ sctp6_input(struct mbuf **i_pak, int *offp, int proto)
struct sctphdr *sh;
struct sctp_chunkhdr *ch;
int length, offset;
-#if !defined(SCTP_WITH_NO_CSUM)
uint8_t compute_crc;
-#endif
#if defined(__FreeBSD__)
uint32_t mflowid;
uint8_t mflowtype;
@@ -292,9 +290,6 @@ sctp6_input(struct mbuf **i_pak, int *offp, int proto)
goto out;
}
ecn_bits = ((ntohl(ip6->ip6_flow) >> 20) & 0x000000ff);
-#if defined(SCTP_WITH_NO_CSUM)
- SCTP_STAT_INCR(sctps_recvnocrc);
-#else
#if defined(__FreeBSD__) && __FreeBSD_version >= 800000
if (m->m_pkthdr.csum_flags & CSUM_SCTP_VALID) {
SCTP_STAT_INCR(sctps_recvhwcrc);
@@ -303,21 +298,18 @@ sctp6_input(struct mbuf **i_pak, int *offp, int proto)
#else
if (SCTP_BASE_SYSCTL(sctp_no_csum_on_loopback) &&
(IN6_ARE_ADDR_EQUAL(&src.sin6_addr, &dst.sin6_addr))) {
- SCTP_STAT_INCR(sctps_recvnocrc);
+ SCTP_STAT_INCR(sctps_recvhwcrc);
compute_crc = 0;
} else {
#endif
SCTP_STAT_INCR(sctps_recvswcrc);
compute_crc = 1;
}
-#endif
sctp_common_input_processing(&m, iphlen, offset, length,
(struct sockaddr *)&src,
(struct sockaddr *)&dst,
sh, ch,
-#if !defined(SCTP_WITH_NO_CSUM)
compute_crc,
-#endif
ecn_bits,
#if defined(__FreeBSD__)
mflowtype, mflowid, fibnum,
@@ -432,8 +424,12 @@ sctp6_notify(struct sctp_inpcb *inp,
}
}
+#if defined(__APPLE__) && !defined(APPLE_LEOPARD) && !defined(APPLE_SNOWLEOPARD) && !defined(APPLE_LION) && !defined(APPLE_MOUNTAINLION) && !defined(APPLE_ELCAPITAN)
void
+sctp6_ctlinput(int cmd, struct sockaddr *pktdst, void *d, struct ifnet *ifp SCTP_UNUSED)
+#else
sctp6_ctlinput(int cmd, struct sockaddr *pktdst, void *d)
+#endif
{
struct ip6ctlparam *ip6cp;
struct sctp_inpcb *inp;
diff --git a/chromium/third_party/usrsctp/usrsctplib/usrsctplib/netinet6/sctp6_var.h b/chromium/third_party/usrsctp/usrsctplib/usrsctplib/netinet6/sctp6_var.h
index a962b1264ee..3c4285d29cb 100755
--- a/chromium/third_party/usrsctp/usrsctplib/usrsctplib/netinet6/sctp6_var.h
+++ b/chromium/third_party/usrsctp/usrsctplib/usrsctplib/netinet6/sctp6_var.h
@@ -76,8 +76,12 @@ void sctp6_ctlinput __P((int, struct sockaddr *, void *));
#else
int sctp6_output(struct sctp_inpcb *, struct mbuf *, struct sockaddr *,
struct mbuf *, struct proc *);
+#if defined(__APPLE__) && !defined(APPLE_LEOPARD) && !defined(APPLE_SNOWLEOPARD) && !defined(APPLE_LION) && !defined(APPLE_MOUNTAINLION) && !defined(APPLE_ELCAPITAN)
+void sctp6_ctlinput(int, struct sockaddr *, void *, struct ifnet * SCTP_UNUSED);
+#else
void sctp6_ctlinput(int, struct sockaddr *, void *);
#endif
+#endif
#if !(defined(__FreeBSD__) || defined(__APPLE__))
extern void in6_sin_2_v4mapsin6(struct sockaddr_in *, struct sockaddr_in6 *);
extern void in6_sin6_2_sin(struct sockaddr_in *, struct sockaddr_in6 *);
diff --git a/chromium/third_party/usrsctp/usrsctplib/usrsctplib/user_environment.h b/chromium/third_party/usrsctp/usrsctplib/usrsctplib/user_environment.h
index 6e37d07c6c8..c11ad2c41ff 100755
--- a/chromium/third_party/usrsctp/usrsctplib/usrsctplib/user_environment.h
+++ b/chromium/third_party/usrsctp/usrsctplib/usrsctplib/user_environment.h
@@ -54,7 +54,7 @@ extern int maxsockets;
extern int hz;
-/* The following two ints define a range of available ephermal ports. */
+/* The following two ints define a range of available ephemeral ports. */
extern int ipport_firstauto, ipport_lastauto;
/* nmbclusters is used in sctp_usrreq.c (e.g., sctp_init). In the FreeBSD kernel,
diff --git a/chromium/third_party/usrsctp/usrsctplib/usrsctplib/user_inpcb.h b/chromium/third_party/usrsctp/usrsctplib/usrsctplib/user_inpcb.h
index c557cd0a13c..81b5d212d70 100755
--- a/chromium/third_party/usrsctp/usrsctplib/usrsctplib/user_inpcb.h
+++ b/chromium/third_party/usrsctp/usrsctplib/usrsctplib/user_inpcb.h
@@ -95,7 +95,7 @@ struct in_conninfo {
/* protocol dependent part */
struct in_endpoints inc_ie;
};
-#define inc_isipv6 inc_flags /* temp compatability */
+#define inc_isipv6 inc_flags /* temp compatibility */
#define inc_fport inc_ie.ie_fport
#define inc_lport inc_ie.ie_lport
#define inc_faddr inc_ie.ie_faddr
diff --git a/chromium/third_party/usrsctp/usrsctplib/usrsctplib/user_recv_thread.c b/chromium/third_party/usrsctp/usrsctplib/usrsctplib/user_recv_thread.c
index b7cb06a09dc..ea0c10efdf9 100755
--- a/chromium/third_party/usrsctp/usrsctplib/usrsctplib/user_recv_thread.c
+++ b/chromium/third_party/usrsctp/usrsctplib/usrsctplib/user_recv_thread.c
@@ -267,9 +267,7 @@ recv_function_raw(void *arg)
struct sctphdr *sh;
uint16_t port;
int offset, ecn = 0;
-#if !defined(SCTP_WITH_NO_CSUM)
int compute_crc = 1;
-#endif
struct sctp_chunkhdr *ch;
struct sockaddr_in src, dst;
#if !defined(__Userspace_os_Windows)
@@ -407,28 +405,22 @@ recv_function_raw(void *arg)
port = 0;
-#if defined(SCTP_WITH_NO_CSUM)
- SCTP_STAT_INCR(sctps_recvnocrc);
-#else
if (SCTP_BASE_SYSCTL(sctp_no_csum_on_loopback) &&
((IN4_ISLOOPBACK_ADDRESS(&src.sin_addr) &&
IN4_ISLOOPBACK_ADDRESS(&dst.sin_addr)) ||
(src.sin_addr.s_addr == dst.sin_addr.s_addr))) {
compute_crc = 0;
- SCTP_STAT_INCR(sctps_recvnocrc);
+ SCTP_STAT_INCR(sctps_recvhwcrc);
} else {
SCTP_STAT_INCR(sctps_recvswcrc);
}
-#endif
SCTPDBG(SCTP_DEBUG_USR, "%s: Received %d bytes.", __func__, n);
SCTPDBG(SCTP_DEBUG_USR, " - calling sctp_common_input_processing with off=%d\n", offset);
sctp_common_input_processing(&recvmbuf[0], sizeof(struct ip), offset, n,
(struct sockaddr *)&src,
(struct sockaddr *)&dst,
sh, ch,
-#if !defined(SCTP_WITH_NO_CSUM)
compute_crc,
-#endif
ecn,
SCTP_DEFAULT_VRFID, port);
if (recvmbuf[0]) {
@@ -477,9 +469,7 @@ recv_function_raw6(void *arg)
int to_fill = MAXLEN_MBUF_CHAIN;
/* iovlen is the size of each mbuf in the chain */
int i, n;
-#if !defined(SCTP_WITH_NO_CSUM)
int compute_crc = 1;
-#endif
unsigned int iovlen = MCLBYTES;
int want_ext = (iovlen > MLEN)? 1 : 0;
int want_header = 0;
@@ -606,25 +596,19 @@ recv_function_raw6(void *arg)
src.sin6_len = sizeof(struct sockaddr_in6);
#endif
src.sin6_port = sh->src_port;
-#if defined(SCTP_WITH_NO_CSUM)
- SCTP_STAT_INCR(sctps_recvnocrc);
-#else
if (memcmp(&src.sin6_addr, &dst.sin6_addr, sizeof(struct in6_addr)) == 0) {
compute_crc = 0;
- SCTP_STAT_INCR(sctps_recvnocrc);
+ SCTP_STAT_INCR(sctps_recvhwcrc);
} else {
SCTP_STAT_INCR(sctps_recvswcrc);
}
-#endif
SCTPDBG(SCTP_DEBUG_USR, "%s: Received %d bytes.", __func__, n);
SCTPDBG(SCTP_DEBUG_USR, " - calling sctp_common_input_processing with off=%d\n", offset);
sctp_common_input_processing(&recvmbuf6[0], 0, offset, n,
(struct sockaddr *)&src,
(struct sockaddr *)&dst,
sh, ch,
-#if !defined(SCTP_WITH_NO_CSUM)
compute_crc,
-#endif
0,
SCTP_DEFAULT_VRFID, 0);
if (recvmbuf6[0]) {
@@ -662,9 +646,7 @@ recv_function_udp(void *arg)
#else
char cmsgbuf[CMSG_SPACE(sizeof(struct in_addr))];
#endif
-#if !defined(SCTP_WITH_NO_CSUM)
int compute_crc = 1;
-#endif
#if !defined(__Userspace_os_Windows)
unsigned int ncounter;
struct iovec iov[MAXLEN_MBUF_CHAIN];
@@ -820,25 +802,19 @@ recv_function_udp(void *arg)
port = src.sin_port;
src.sin_port = sh->src_port;
dst.sin_port = sh->dest_port;
-#if defined(SCTP_WITH_NO_CSUM)
- SCTP_STAT_INCR(sctps_recvnocrc);
-#else
if (src.sin_addr.s_addr == dst.sin_addr.s_addr) {
compute_crc = 0;
- SCTP_STAT_INCR(sctps_recvnocrc);
+ SCTP_STAT_INCR(sctps_recvhwcrc);
} else {
SCTP_STAT_INCR(sctps_recvswcrc);
}
-#endif
SCTPDBG(SCTP_DEBUG_USR, "%s: Received %d bytes.", __func__, n);
SCTPDBG(SCTP_DEBUG_USR, " - calling sctp_common_input_processing with off=%d\n", offset);
sctp_common_input_processing(&udprecvmbuf[0], 0, offset, n,
(struct sockaddr *)&src,
(struct sockaddr *)&dst,
sh, ch,
-#if !defined(SCTP_WITH_NO_CSUM)
compute_crc,
-#endif
0,
SCTP_DEFAULT_VRFID, port);
if (udprecvmbuf[0]) {
@@ -872,9 +848,7 @@ recv_function_udp6(void *arg)
uint16_t port;
struct sctp_chunkhdr *ch;
char cmsgbuf[CMSG_SPACE(sizeof (struct in6_pktinfo))];
-#if !defined(SCTP_WITH_NO_CSUM)
int compute_crc = 1;
-#endif
#if !defined(__Userspace_os_Windows)
unsigned int ncounter;
struct iovec iov[MAXLEN_MBUF_CHAIN];
@@ -1016,25 +990,19 @@ recv_function_udp6(void *arg)
port = src.sin6_port;
src.sin6_port = sh->src_port;
dst.sin6_port = sh->dest_port;
-#if defined(SCTP_WITH_NO_CSUM)
- SCTP_STAT_INCR(sctps_recvnocrc);
-#else
if ((memcmp(&src.sin6_addr, &dst.sin6_addr, sizeof(struct in6_addr)) == 0)) {
compute_crc = 0;
- SCTP_STAT_INCR(sctps_recvnocrc);
+ SCTP_STAT_INCR(sctps_recvhwcrc);
} else {
SCTP_STAT_INCR(sctps_recvswcrc);
}
-#endif
SCTPDBG(SCTP_DEBUG_USR, "%s: Received %d bytes.", __func__, n);
SCTPDBG(SCTP_DEBUG_USR, " - calling sctp_common_input_processing with off=%d\n", (int)sizeof(struct sctphdr));
sctp_common_input_processing(&udprecvmbuf6[0], 0, offset, n,
(struct sockaddr *)&src,
(struct sockaddr *)&dst,
sh, ch,
-#if !defined(SCTP_WITH_NO_CSUM)
compute_crc,
-#endif
0,
SCTP_DEFAULT_VRFID, port);
if (udprecvmbuf6[0]) {
diff --git a/chromium/third_party/usrsctp/usrsctplib/usrsctplib/user_socket.c b/chromium/third_party/usrsctp/usrsctplib/usrsctplib/user_socket.c
index 8122e5856d4..7261c9a9961 100755
--- a/chromium/third_party/usrsctp/usrsctplib/usrsctplib/user_socket.c
+++ b/chromium/third_party/usrsctp/usrsctplib/usrsctplib/user_socket.c
@@ -3491,9 +3491,7 @@ usrsctp_conninput(void *addr, const void *buffer, size_t length, uint8_t ecn_bit
(struct sockaddr *)&src,
(struct sockaddr *)&dst,
sh, ch,
-#if !defined(SCTP_WITH_NO_CSUM)
SCTP_BASE_VAR(crc32c_offloaded) == 1 ? 0 : 1,
-#endif
ecn_bits,
SCTP_DEFAULT_VRFID, 0);
if (m) {
@@ -3519,9 +3517,7 @@ USRSCTP_SYSCTL_SET_DEF(sctp_asconf_enable)
USRSCTP_SYSCTL_SET_DEF(sctp_reconfig_enable)
USRSCTP_SYSCTL_SET_DEF(sctp_nrsack_enable)
USRSCTP_SYSCTL_SET_DEF(sctp_pktdrop_enable)
-#if !defined(SCTP_WITH_NO_CSUM)
USRSCTP_SYSCTL_SET_DEF(sctp_no_csum_on_loopback)
-#endif
USRSCTP_SYSCTL_SET_DEF(sctp_peer_chunk_oh)
USRSCTP_SYSCTL_SET_DEF(sctp_max_burst_default)
USRSCTP_SYSCTL_SET_DEF(sctp_max_chunks_on_queue)
@@ -3600,9 +3596,7 @@ USRSCTP_SYSCTL_GET_DEF(sctp_asconf_enable)
USRSCTP_SYSCTL_GET_DEF(sctp_reconfig_enable)
USRSCTP_SYSCTL_GET_DEF(sctp_nrsack_enable)
USRSCTP_SYSCTL_GET_DEF(sctp_pktdrop_enable)
-#if !defined(SCTP_WITH_NO_CSUM)
USRSCTP_SYSCTL_GET_DEF(sctp_no_csum_on_loopback)
-#endif
USRSCTP_SYSCTL_GET_DEF(sctp_peer_chunk_oh)
USRSCTP_SYSCTL_GET_DEF(sctp_max_burst_default)
USRSCTP_SYSCTL_GET_DEF(sctp_max_chunks_on_queue)
diff --git a/chromium/third_party/usrsctp/usrsctplib/usrsctplib/usrsctp.h b/chromium/third_party/usrsctp/usrsctplib/usrsctplib/usrsctp.h
index 70b719a8ccb..16159f691ef 100644
--- a/chromium/third_party/usrsctp/usrsctplib/usrsctplib/usrsctp.h
+++ b/chromium/third_party/usrsctp/usrsctplib/usrsctplib/usrsctp.h
@@ -1041,9 +1041,7 @@ USRSCTP_SYSCTL_DECL(sctp_asconf_enable)
USRSCTP_SYSCTL_DECL(sctp_reconfig_enable)
USRSCTP_SYSCTL_DECL(sctp_nrsack_enable)
USRSCTP_SYSCTL_DECL(sctp_pktdrop_enable)
-#if !defined(SCTP_WITH_NO_CSUM)
USRSCTP_SYSCTL_DECL(sctp_no_csum_on_loopback)
-#endif
USRSCTP_SYSCTL_DECL(sctp_peer_chunk_oh)
USRSCTP_SYSCTL_DECL(sctp_max_burst_default)
USRSCTP_SYSCTL_DECL(sctp_max_chunks_on_queue)
@@ -1156,7 +1154,7 @@ struct sctpstat {
uint32_t sctps_recvauthfailed; /* total number of auth failed */
uint32_t sctps_recvexpress; /* total fast path receives all one chunk */
uint32_t sctps_recvexpressm; /* total fast path multi-part data */
- uint32_t sctps_recvnocrc;
+ uint32_t sctps_recv_spare; /* formerly sctps_recvnocrc */
uint32_t sctps_recvswcrc;
uint32_t sctps_recvhwcrc;
@@ -1173,7 +1171,7 @@ struct sctpstat {
uint32_t sctps_sendecne; /* total output ECNE chunks */
uint32_t sctps_sendauth; /* total output AUTH chunks FIXME */
uint32_t sctps_senderrors; /* ip_output error counter */
- uint32_t sctps_sendnocrc;
+ uint32_t sctps_send_spare; /* formerly sctps_sendnocrc */
uint32_t sctps_sendswcrc;
uint32_t sctps_sendhwcrc;
/* PCKDROPREP statistics: */