Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 5 May 2019 08:08:15 +0000 (UTC)
From:      Michael Tuexen <tuexen@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org
Subject:   svn commit: r347144 - stable/11/sys/netinet
Message-ID:  <201905050808.x4588F37093645@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: tuexen
Date: Sun May  5 08:08:15 2019
New Revision: 347144
URL: https://svnweb.freebsd.org/changeset/base/347144

Log:
  MFC r335179:
  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:
  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 08:06:32 2019	(r347143)
+++ stable/11/sys/netinet/sctp_output.c	Sun May  5 08:08:15 2019	(r347144)
@@ -4394,7 +4394,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;
 
 			/*
@@ -11257,7 +11257,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);



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