diff options
author | tuexen <tuexen@FreeBSD.org> | 2010-12-30 21:32:35 +0000 |
---|---|---|
committer | tuexen <tuexen@FreeBSD.org> | 2010-12-30 21:32:35 +0000 |
commit | 12d4883ccf51c51d512fc50f38d6fba359e78fd3 (patch) | |
tree | 01d2d584408afde4e2cdf35e0cac80a0d93045d2 /sys/netinet/sctp_timer.c | |
parent | 543d6f8f19d01a1c2b2c7ae511afd03acf3176d2 (diff) | |
download | FreeBSD-src-12d4883ccf51c51d512fc50f38d6fba359e78fd3.zip FreeBSD-src-12d4883ccf51c51d512fc50f38d6fba359e78fd3.tar.gz |
Define and use SCTP_SSN_GE, SCTP_SSN_GT, SCTP_TSN_GE, SCTP_TSN_GT macros
and use them instead of the generic compare_with_wrap.
Retire compare_with_wrap.
MFC after: 3 months.
Diffstat (limited to 'sys/netinet/sctp_timer.c')
-rw-r--r-- | sys/netinet/sctp_timer.c | 14 |
1 files changed, 3 insertions, 11 deletions
diff --git a/sys/netinet/sctp_timer.c b/sys/netinet/sctp_timer.c index 6001690..6ecc178 100644 --- a/sys/netinet/sctp_timer.c +++ b/sys/netinet/sctp_timer.c @@ -577,11 +577,7 @@ sctp_recover_sent_list(struct sctp_tcb *stcb) asoc = &stcb->asoc; TAILQ_FOREACH_SAFE(chk, &asoc->sent_queue, sctp_next, nchk) { - if ((compare_with_wrap(asoc->last_acked_seq, - chk->rec.data.TSN_seq, - MAX_TSN)) || - (asoc->last_acked_seq == chk->rec.data.TSN_seq)) { - + if (SCTP_TSN_GE(asoc->last_acked_seq, chk->rec.data.TSN_seq)) { SCTP_PRINTF("Found chk:%p tsn:%x <= last_acked_seq:%x\n", chk, chk->rec.data.TSN_seq, asoc->last_acked_seq); TAILQ_REMOVE(&asoc->sent_queue, chk, sctp_next); @@ -692,10 +688,7 @@ sctp_mark_all_for_resend(struct sctp_tcb *stcb, start_again: #endif TAILQ_FOREACH_SAFE(chk, &stcb->asoc.sent_queue, sctp_next, nchk) { - if ((compare_with_wrap(stcb->asoc.last_acked_seq, - chk->rec.data.TSN_seq, - MAX_TSN)) || - (stcb->asoc.last_acked_seq == chk->rec.data.TSN_seq)) { + if (SCTP_TSN_GE(stcb->asoc.last_acked_seq, chk->rec.data.TSN_seq)) { /* Strange case our list got out of order? */ SCTP_PRINTF("Our list is out of order? last_acked:%x chk:%x", (unsigned int)stcb->asoc.last_acked_seq, (unsigned int)chk->rec.data.TSN_seq); @@ -1150,8 +1143,7 @@ sctp_t3rxt_timer(struct sctp_inpcb *inp, lchk = sctp_try_advance_peer_ack_point(stcb, &stcb->asoc); /* C3. See if we need to send a Fwd-TSN */ - if (compare_with_wrap(stcb->asoc.advanced_peer_ack_point, - stcb->asoc.last_acked_seq, MAX_TSN)) { + if (SCTP_TSN_GT(stcb->asoc.advanced_peer_ack_point, stcb->asoc.last_acked_seq)) { /* * ISSUE with ECN, see FWD-TSN processing for notes * on issues that will occur when the ECN NONCE |