From 5150ee40f45fe9cdef03b4454bfde7e099860673 Mon Sep 17 00:00:00 2001 From: Seth Hampson Date: Wed, 4 Apr 2018 17:39:19 -0700 Subject: [PATCH] Changing MTU size for SCTP socket options. With the latest usrsctp roll, the MTU value you provide is the space avaiable for chunks in the packet. We previously specified this to be the MTU for the entire SCTP packet, so we were logging errors when the SCTP packets were 12 bytes larger than expected (the size of the SCTP header). This fix updates our MTU specified to account for the SCTP header size as well. Bug: webrtc:9082 Change-Id: Id3bfa839d4e7662230111ebbdf33bd81ccdc7cf4 Reviewed-on: https://webrtc-review.googlesource.com/66943 Reviewed-by: Taylor Brandstetter Commit-Queue: Seth Hampson Cr-Commit-Position: refs/heads/master@{#22754} --- media/sctp/sctptransport.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/media/sctp/sctptransport.cc b/media/sctp/sctptransport.cc index bcfb4f4c2f..6e047e2a87 100644 --- a/media/sctp/sctptransport.cc +++ b/media/sctp/sctptransport.cc @@ -656,7 +656,9 @@ bool SctpTransport::Connect() { sctp_paddrparams params = {{0}}; memcpy(¶ms.spp_address, &remote_sconn, sizeof(remote_sconn)); params.spp_flags = SPP_PMTUD_DISABLE; - params.spp_pathmtu = kSctpMtu; + // The MTU value provided specifies the space available for chunks in the + // packet, so we subtract the SCTP header size. + params.spp_pathmtu = kSctpMtu - sizeof(struct sctp_common_header); if (usrsctp_setsockopt(sock_, IPPROTO_SCTP, SCTP_PEER_ADDR_PARAMS, ¶ms, sizeof(params))) { RTC_LOG_ERRNO(LS_ERROR) << debug_name_ << "->Connect(): "