svn commit: r335179 - head/sys/netinet

Michael Tuexen tuexen at FreeBSD.org
Thu Jun 14 21:30:53 UTC 2018


Author: tuexen
Date: Thu Jun 14 21:30:52 2018
New Revision: 335179
URL: https://svnweb.freebsd.org/changeset/base/335179

Log:
  Provide the ip6_plen in network byte order when calling ip6_output().
  
  This is not strictly required by ip6_output(), since it overrides it,
  but it is needed for upcoming dtrace support.

Modified:
  head/sys/netinet/sctp_output.c

Modified: head/sys/netinet/sctp_output.c
==============================================================================
--- head/sys/netinet/sctp_output.c	Thu Jun 14 21:29:31 2018	(r335178)
+++ head/sys/netinet/sctp_output.c	Thu Jun 14 21:30:52 2018	(r335179)
@@ -4396,7 +4396,7 @@ sctp_lowlevel_chunk_output(struct sctp_inpcb *inp,
 			} else {
 				ip6h->ip6_nxt = IPPROTO_SCTP;
 			}
-			ip6h->ip6_plen = (uint16_t)(packet_length - sizeof(struct ip6_hdr));
+			ip6h->ip6_plen = htons(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 = (uint16_t)(len - sizeof(struct ip6_hdr));
+		ip6->ip6_plen = htons(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-head mailing list