diff options
author | t00fcxen <t00fcxen@9df1edf5-d72c-5b5f-11c0-5f5209eb73f7> | 2013-11-07 16:26:01 +0000 |
---|---|---|
committer | t00fcxen <t00fcxen@9df1edf5-d72c-5b5f-11c0-5f5209eb73f7> | 2013-11-07 16:26:01 +0000 |
commit | 5310a647a74c51d125d106f350ff224bb017b0a5 (patch) | |
tree | 57ac429f5474be56f5e0c8c741cddc9ea990de73 | |
parent | 6094da0ffddb92b1921fb00169cd740ef64807de (diff) | |
download | usrsctplib-5310a647a74c51d125d106f350ff224bb017b0a5.tar.gz |
Use htons/ntohs were appropriate.
These issues were reported by Andrew Galante.
git-svn-id: http://sctp-refimpl.googlecode.com/svn/trunk/KERN/usrsctp/usrsctplib@8693 9df1edf5-d72c-5b5f-11c0-5f5209eb73f7
-rwxr-xr-x | netinet/sctp_asconf.c | 2 | ||||
-rwxr-xr-x | netinet/sctputil.c | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/netinet/sctp_asconf.c b/netinet/sctp_asconf.c index af1ac67..670f15a 100755 --- a/netinet/sctp_asconf.c +++ b/netinet/sctp_asconf.c @@ -2741,7 +2741,7 @@ sctp_compose_asconf(struct sctp_tcb *stcb, int *retlen, int addr_locked) /* 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); } diff --git a/netinet/sctputil.c b/netinet/sctputil.c index b3eb351..e90390d 100755 --- a/netinet/sctputil.c +++ b/netinet/sctputil.c @@ -2721,7 +2721,7 @@ sctp_notify_assoc_change(uint16_t state, struct sctp_tcb *stcb, 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; } @@ -3617,7 +3617,7 @@ sctp_notify_remote_error(struct sctp_tcb *stcb, uint16_t error, struct sctp_erro return; } if (chunk != NULL) { - chunk_len = htons(chunk->ch.chunk_length); + chunk_len = ntohs(chunk->ch.chunk_length); } else { chunk_len = 0; } |