Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 12 Aug 2018 14:05:16 +0000 (UTC)
From:      Michael Tuexen <tuexen@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r337688 - head/sys/netinet
Message-ID:  <201808121405.w7CE5GBH092581@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: tuexen
Date: Sun Aug 12 14:05:15 2018
New Revision: 337688
URL: https://svnweb.freebsd.org/changeset/base/337688

Log:
  Add explicit cast to silence a warning for the userland stack.
  
  Thanks to Felix Weinrank for providing the patch.

Modified:
  head/sys/netinet/sctp_output.c

Modified: head/sys/netinet/sctp_output.c
==============================================================================
--- head/sys/netinet/sctp_output.c	Sun Aug 12 13:29:40 2018	(r337687)
+++ head/sys/netinet/sctp_output.c	Sun Aug 12 14:05:15 2018	(r337688)
@@ -4396,7 +4396,7 @@ sctp_lowlevel_chunk_output(struct sctp_inpcb *inp,
 			} else {
 				ip6h->ip6_nxt = IPPROTO_SCTP;
 			}
-			ip6h->ip6_plen = htons(packet_length - sizeof(struct ip6_hdr));
+			ip6h->ip6_plen = htons((uint16_t)(packet_length - sizeof(struct ip6_hdr)));
 			ip6h->ip6_dst = sin6->sin6_addr;
 
 			/*
@@ -11258,7 +11258,7 @@ sctp_send_resp_msg(struct sockaddr *src, struct sockad
 #endif
 #ifdef INET6
 	case AF_INET6:
-		ip6->ip6_plen = htons(len - sizeof(struct ip6_hdr));
+		ip6->ip6_plen = htons((uint16_t)(len - sizeof(struct ip6_hdr)));
 		if (port) {
 			shout->checksum = sctp_calculate_cksum(mout, sizeof(struct ip6_hdr) + sizeof(struct udphdr));
 			SCTP_STAT_INCR(sctps_sendswcrc);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201808121405.w7CE5GBH092581>