svn commit: r266056 - stable/9/sys/netinet

Michael Tuexen tuexen at FreeBSD.org
Wed May 14 17:26:07 UTC 2014


Author: tuexen
Date: Wed May 14 17:26:06 2014
New Revision: 266056
URL: http://svnweb.freebsd.org/changeset/base/266056

Log:
  MFC r257800:
  
  Use htons()/ntohs() appropriately.
  These issues were reported by Andrew Galante.

Modified:
  stable/9/sys/netinet/sctp_asconf.c
  stable/9/sys/netinet/sctputil.c
Directory Properties:
  stable/9/sys/   (props changed)

Modified: stable/9/sys/netinet/sctp_asconf.c
==============================================================================
--- stable/9/sys/netinet/sctp_asconf.c	Wed May 14 17:19:42 2014	(r266055)
+++ stable/9/sys/netinet/sctp_asconf.c	Wed May 14 17:26:06 2014	(r266056)
@@ -2737,7 +2737,7 @@ sctp_compose_asconf(struct sctp_tcb *stc
 	/* chain it all together */
 	SCTP_BUF_NEXT(m_asconf_chk) = m_asconf;
 	*retlen = SCTP_BUF_LEN(m_asconf_chk) + SCTP_BUF_LEN(m_asconf);
-	acp->ch.chunk_length = ntohs(*retlen);
+	acp->ch.chunk_length = htons(*retlen);
 
 	return (m_asconf_chk);
 }

Modified: stable/9/sys/netinet/sctputil.c
==============================================================================
--- stable/9/sys/netinet/sctputil.c	Wed May 14 17:19:42 2014	(r266055)
+++ stable/9/sys/netinet/sctputil.c	Wed May 14 17:26:06 2014	(r266056)
@@ -2602,7 +2602,7 @@ sctp_notify_assoc_change(uint16_t state,
 	if (sctp_stcb_is_feature_on(stcb->sctp_ep, stcb, SCTP_PCB_FLAGS_RECVASSOCEVNT)) {
 		notif_len = sizeof(struct sctp_assoc_change);
 		if (abort != NULL) {
-			abort_len = htons(abort->ch.chunk_length);
+			abort_len = ntohs(abort->ch.chunk_length);
 		} else {
 			abort_len = 0;
 		}
@@ -3474,7 +3474,7 @@ sctp_notify_remote_error(struct sctp_tcb
 		return;
 	}
 	if (chunk != NULL) {
-		chunk_len = htons(chunk->ch.chunk_length);
+		chunk_len = ntohs(chunk->ch.chunk_length);
 	} else {
 		chunk_len = 0;
 	}


More information about the svn-src-stable-9 mailing list