Author: tuexen
Date: Sat Sep  7 11:56:43 2019
New Revision: 352000
URL: https://svnweb.freebsd.org/changeset/base/352000

Log:
  MFC r350625:
  
  Fix build issues for the userland stack on Raspbian.

Modified:
  stable/12/sys/netinet/sctp_output.c
  stable/12/sys/netinet/sctputil.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/netinet/sctp_output.c
==============================================================================
--- stable/12/sys/netinet/sctp_output.c Sat Sep  7 11:52:35 2019        
(r351999)
+++ stable/12/sys/netinet/sctp_output.c Sat Sep  7 11:56:43 2019        
(r352000)
@@ -12534,7 +12534,7 @@ sctp_lower_sosend(struct socket *so,
     struct thread *p
 )
 {
-       ssize_t sndlen = 0, max_len;
+       ssize_t sndlen = 0, max_len, local_add_more;
        int error, len;
        struct mbuf *top = NULL;
        int queue_only = 0, queue_only_for_init = 0;
@@ -12556,7 +12556,6 @@ sctp_lower_sosend(struct socket *so,
        int got_all_of_the_send = 0;
        int hold_tcblock = 0;
        int non_blocking = 0;
-       uint32_t local_add_more;
        ssize_t local_soresv = 0;
        uint16_t port;
        uint16_t sinfo_flags;
@@ -12860,7 +12859,7 @@ sctp_lower_sosend(struct socket *so,
        free_cnt_applied = 1;
 
        if (sctp_is_feature_on(inp, SCTP_PCB_FLAGS_NO_FRAGMENT)) {
-               if (sndlen > asoc->smallest_mtu) {
+               if (sndlen > (ssize_t)asoc->smallest_mtu) {
                        SCTP_LTRACE_ERR_RET(inp, stcb, net, 
SCTP_FROM_SCTP_OUTPUT, EMSGSIZE);
                        error = EMSGSIZE;
                        goto out_unlocked;
@@ -12888,7 +12887,7 @@ sctp_lower_sosend(struct socket *so,
                if ((SCTP_SB_LIMIT_SND(so) < (amount + inqueue_bytes + 
stcb->asoc.sb_send_resv)) ||
                    (stcb->asoc.chunks_on_out_queue >= 
SCTP_BASE_SYSCTL(sctp_max_chunks_on_queue))) {
                        SCTP_LTRACE_ERR_RET(inp, stcb, net, 
SCTP_FROM_SCTP_OUTPUT, EWOULDBLOCK);
-                       if (sndlen > SCTP_SB_LIMIT_SND(so))
+                       if (sndlen > (ssize_t)SCTP_SB_LIMIT_SND(so))
                                error = EMSGSIZE;
                        else
                                error = EWOULDBLOCK;
@@ -13070,7 +13069,7 @@ sctp_lower_sosend(struct socket *so,
 
        /* Unless E_EOR mode is on, we must make a send FIT in one call. */
        if ((user_marks_eor == 0) &&
-           (sndlen > SCTP_SB_LIMIT_SND(stcb->sctp_socket))) {
+           (sndlen > (ssize_t)SCTP_SB_LIMIT_SND(stcb->sctp_socket))) {
                /* It will NEVER fit */
                SCTP_LTRACE_ERR_RET(NULL, stcb, net, SCTP_FROM_SCTP_OUTPUT, 
EMSGSIZE);
                error = EMSGSIZE;
@@ -13087,20 +13086,20 @@ sctp_lower_sosend(struct socket *so,
        }
 
        if (user_marks_eor) {
-               local_add_more = min(SCTP_SB_LIMIT_SND(so), 
SCTP_BASE_SYSCTL(sctp_add_more_threshold));
+               local_add_more = (ssize_t)min(SCTP_SB_LIMIT_SND(so), 
SCTP_BASE_SYSCTL(sctp_add_more_threshold));
        } else {
                /*-
                 * For non-eeor the whole message must fit in
                 * the socket send buffer.
                 */
-               local_add_more = (uint32_t)sndlen;
+               local_add_more = sndlen;
        }
        len = 0;
        if (non_blocking) {
                goto skip_preblock;
        }
        if (((max_len <= local_add_more) &&
-           (SCTP_SB_LIMIT_SND(so) >= local_add_more)) ||
+           ((ssize_t)SCTP_SB_LIMIT_SND(so) >= local_add_more)) ||
            (max_len == 0) ||
            ((stcb->asoc.chunks_on_out_queue + stcb->asoc.stream_queue_cnt) >= 
SCTP_BASE_SYSCTL(sctp_max_chunks_on_queue))) {
                /* No room right now ! */
@@ -13108,7 +13107,7 @@ sctp_lower_sosend(struct socket *so,
                inqueue_bytes = stcb->asoc.total_output_queue_size - 
(stcb->asoc.chunks_on_out_queue * SCTP_DATA_CHUNK_OVERHEAD(stcb));
                while ((SCTP_SB_LIMIT_SND(so) < (inqueue_bytes + 
local_add_more)) ||
                    ((stcb->asoc.stream_queue_cnt + 
stcb->asoc.chunks_on_out_queue) >= SCTP_BASE_SYSCTL(sctp_max_chunks_on_queue))) 
{
-                       SCTPDBG(SCTP_DEBUG_OUTPUT1, "pre_block limit:%u 
<(inq:%d + %d) || (%d+%d > %d)\n",
+                       SCTPDBG(SCTP_DEBUG_OUTPUT1, "pre_block limit:%u 
<(inq:%d + %zd) || (%d+%d > %d)\n",
                            (unsigned int)SCTP_SB_LIMIT_SND(so),
                            inqueue_bytes,
                            local_add_more,
@@ -13241,7 +13240,7 @@ skip_preblock:
                        else
                                max_len = 0;
 
-                       if ((max_len > 
SCTP_BASE_SYSCTL(sctp_add_more_threshold)) ||
+                       if ((max_len > 
(ssize_t)SCTP_BASE_SYSCTL(sctp_add_more_threshold)) ||
                            (max_len && (SCTP_SB_LIMIT_SND(so) < 
SCTP_BASE_SYSCTL(sctp_add_more_threshold))) ||
                            (uio->uio_resid && (uio->uio_resid <= max_len))) {
                                sndout = 0;

Modified: stable/12/sys/netinet/sctputil.c
==============================================================================
--- stable/12/sys/netinet/sctputil.c    Sat Sep  7 11:52:35 2019        
(r351999)
+++ stable/12/sys/netinet/sctputil.c    Sat Sep  7 11:56:43 2019        
(r352000)
@@ -5926,7 +5926,7 @@ get_more_data:
                }
                if ((uio->uio_resid == 0) ||
                    ((in_eeor_mode) &&
-                   (copied_so_far >= (uint32_t)max(so->so_rcv.sb_lowat, 1)))) {
+                   (copied_so_far >= max(so->so_rcv.sb_lowat, 1)))) {
                        goto release;
                }
                /*
_______________________________________________
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to