mirror of
https://git.FreeBSD.org/src.git
synced 2024-12-24 11:29:10 +00:00
Use htons()/ntohs() appropriately.
These issues were reported by Andrew Galante. MFC after: 3 days
This commit is contained in:
parent
1bb0777e41
commit
c9eb4473b4
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=257800
@ -2737,7 +2737,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);
|
||||
}
|
||||
|
@ -2602,7 +2602,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;
|
||||
}
|
||||
@ -3474,7 +3474,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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user