Fix three bugs related to the sequence number wrap-around affecting

the processing of ECNE and ASCONF chunks.

Reviewed by: rrs
MFC after: 3 days.
This commit is contained in:
Michael Tuexen 2010-12-30 16:23:13 +00:00
parent aab88d9da4
commit 8ced7318a0
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=216821
3 changed files with 3 additions and 3 deletions

View File

@ -632,7 +632,7 @@ sctp_handle_asconf(struct mbuf *m, unsigned int offset,
asoc = &stcb->asoc;
serial_num = ntohl(cp->serial_number);
if (compare_with_wrap(asoc->asconf_seq_in, serial_num, MAX_SEQ) ||
if (compare_with_wrap(asoc->asconf_seq_in, serial_num, MAX_TSN) ||
serial_num == asoc->asconf_seq_in) {
/* got a duplicate ASCONF */
SCTPDBG(SCTP_DEBUG_ASCONF1,

View File

@ -2944,7 +2944,7 @@ sctp_handle_ecn_echo(struct sctp_ecne_chunk *cp,
net = lchk->whoTo;
break;
}
if (compare_with_wrap(lchk->rec.data.TSN_seq, tsn, MAX_SEQ))
if (compare_with_wrap(lchk->rec.data.TSN_seq, tsn, MAX_TSN))
break;
lchk = TAILQ_NEXT(lchk, sctp_next);
}

View File

@ -6477,7 +6477,7 @@ sctp_toss_old_asconf(struct sctp_tcb *stcb)
if (chk->rec.chunk_id.id == SCTP_ASCONF) {
if (chk->data) {
acp = mtod(chk->data, struct sctp_asconf_chunk *);
if (compare_with_wrap(ntohl(acp->serial_number), stcb->asoc.asconf_seq_out_acked, MAX_SEQ)) {
if (compare_with_wrap(ntohl(acp->serial_number), stcb->asoc.asconf_seq_out_acked, MAX_TSN)) {
/* Not Acked yet */
break;
}