Date: Thu, 7 Nov 2013 16:37:12 +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: r257800 - head/sys/netinet Message-ID: <201311071637.rA7GbCvW063692@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: tuexen Date: Thu Nov 7 16:37:12 2013 New Revision: 257800 URL: http://svnweb.freebsd.org/changeset/base/257800 Log: Use htons()/ntohs() appropriately. These issues were reported by Andrew Galante. MFC after: 3 days Modified: head/sys/netinet/sctp_asconf.c head/sys/netinet/sctputil.c Modified: head/sys/netinet/sctp_asconf.c ============================================================================== --- head/sys/netinet/sctp_asconf.c Thu Nov 7 16:24:31 2013 (r257799) +++ head/sys/netinet/sctp_asconf.c Thu Nov 7 16:37:12 2013 (r257800) @@ -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: head/sys/netinet/sctputil.c ============================================================================== --- head/sys/netinet/sctputil.c Thu Nov 7 16:24:31 2013 (r257799) +++ head/sys/netinet/sctputil.c Thu Nov 7 16:37:12 2013 (r257800) @@ -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; }
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201311071637.rA7GbCvW063692>