svn commit: r347162 - stable/11/sys/netinet

Michael Tuexen tuexen at FreeBSD.org
Sun May 5 19:31:19 UTC 2019


Author: tuexen
Date: Sun May  5 19:31:17 2019
New Revision: 347162
URL: https://svnweb.freebsd.org/changeset/base/347162

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

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

Modified: stable/11/sys/netinet/sctp_output.c
==============================================================================
--- stable/11/sys/netinet/sctp_output.c	Sun May  5 19:20:27 2019	(r347161)
+++ stable/11/sys/netinet/sctp_output.c	Sun May  5 19:31:17 2019	(r347162)
@@ -4394,7 +4394,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;
 
 			/*
@@ -11256,7 +11256,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);


More information about the svn-src-all mailing list