diff options
author | rrs <rrs@FreeBSD.org> | 2009-03-04 20:54:42 +0000 |
---|---|---|
committer | rrs <rrs@FreeBSD.org> | 2009-03-04 20:54:42 +0000 |
commit | f2254573b9b4dd71026af9f45fe5afc41b9aff24 (patch) | |
tree | 84f7529f534e4b84b293b323b6fb7e6579c26e36 | |
parent | 989d9cb005be3cdfa14984b55ffeec182febe689 (diff) | |
download | FreeBSD-src-f2254573b9b4dd71026af9f45fe5afc41b9aff24.zip FreeBSD-src-f2254573b9b4dd71026af9f45fe5afc41b9aff24.tar.gz |
- PR-SCTP bug, where the CUM-ACK was not being updated
into the advance_peer_ack point so we would incorrectly
send a wrong value in the FWD-TSN
- PR-SCTP bug, where an PR packet is used for a window
probe which could incorrectly get the packet moved
back into the send_queue, which will cause major issues and
should not happen.
- Fix a trace to use the proper macro.
-rw-r--r-- | sys/netinet/sctp_constants.h | 3 | ||||
-rw-r--r-- | sys/netinet/sctp_indata.c | 38 | ||||
-rw-r--r-- | sys/netinet/sctp_os_bsd.h | 2 |
3 files changed, 27 insertions, 16 deletions
diff --git a/sys/netinet/sctp_constants.h b/sys/netinet/sctp_constants.h index d8f3627..bdd1849 100644 --- a/sys/netinet/sctp_constants.h +++ b/sys/netinet/sctp_constants.h @@ -228,8 +228,9 @@ __FBSDID("$FreeBSD$"); #define SCTP_MAP_TSN_ENTERS 119 #define SCTP_THRESHOLD_CLEAR 120 #define SCTP_THRESHOLD_INCR 121 +#define SCTP_FLIGHT_LOG_DWN_WP_FWD 122 -#define SCTP_LOG_MAX_TYPES 122 +#define SCTP_LOG_MAX_TYPES 123 /* * To turn on various logging, you must first enable 'options KTR' and * you might want to bump the entires 'options KTR_ENTRIES=80000'. diff --git a/sys/netinet/sctp_indata.c b/sys/netinet/sctp_indata.c index a1a8d7a..655ce83 100644 --- a/sys/netinet/sctp_indata.c +++ b/sys/netinet/sctp_indata.c @@ -4182,6 +4182,18 @@ sctp_window_probe_recovery(struct sctp_tcb *stcb, struct sctp_tmit_chunk *chk; /* First setup this one and get it moved back */ + sctp_flight_size_decrease(tp1); + sctp_total_flight_decrease(stcb, tp1); + tp1->window_probe = 0; + if ((tp1->sent == SCTP_FORWARD_TSN_SKIP) || (tp1->data == NULL)) { + /* TSN's skipped we do NOT move back. */ + sctp_misc_ints(SCTP_FLIGHT_LOG_DWN_WP_FWD, + tp1->whoTo->flight_size, + tp1->book_size, + (uintptr_t) tp1->whoTo, + tp1->rec.data.TSN_seq); + return; + } tp1->sent = SCTP_DATAGRAM_UNSENT; if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_FLIGHT_LOGGING_ENABLE) { sctp_misc_ints(SCTP_FLIGHT_LOG_DOWN_WP, @@ -4190,8 +4202,6 @@ sctp_window_probe_recovery(struct sctp_tcb *stcb, (uintptr_t) tp1->whoTo, tp1->rec.data.TSN_seq); } - sctp_flight_size_decrease(tp1); - sctp_total_flight_decrease(stcb, tp1); TAILQ_REMOVE(&asoc->sent_queue, tp1, sctp_next); TAILQ_INSERT_HEAD(&asoc->send_queue, tp1, sctp_next); asoc->sent_queue_cnt--; @@ -4480,10 +4490,6 @@ sctp_express_handle_sack(struct sctp_tcb *stcb, uint32_t cumack, asoc->total_flight = 0; asoc->total_flight_count = 0; } - /* Fix up the a-p-a-p for future PR-SCTP sends */ - if (compare_with_wrap(cumack, asoc->advanced_peer_ack_point, MAX_TSN)) { - asoc->advanced_peer_ack_point = cumack; - } /* ECN Nonce updates */ if (asoc->ecn_nonce_allowed) { if (asoc->nonce_sum_check) { @@ -4699,6 +4705,14 @@ again: stcb->sctp_ep, stcb, asoc->primary_destination); } } + /*********************************************/ + /* Here we perform PR-SCTP procedures */ + /* (section 4.2) */ + /*********************************************/ + /* C1. update advancedPeerAckPoint */ + if (compare_with_wrap(cumack, asoc->advanced_peer_ack_point, MAX_TSN)) { + asoc->advanced_peer_ack_point = cumack; + } /* PR-Sctp issues need to be addressed too */ if ((asoc->peer_supports_prsctp) && (asoc->pr_sctp_cnt > 0)) { struct sctp_tmit_chunk *lchk; @@ -5446,14 +5460,6 @@ done_with_it: sctp_strike_gap_ack_chunks(stcb, asoc, biggest_tsn_acked, biggest_tsn_newly_acked, this_sack_lowest_newack, accum_moved); } - /*********************************************/ - /* Here we perform PR-SCTP procedures */ - /* (section 4.2) */ - /*********************************************/ - /* C1. update advancedPeerAckPoint */ - if (compare_with_wrap(cum_ack, asoc->advanced_peer_ack_point, MAX_TSN)) { - asoc->advanced_peer_ack_point = cum_ack; - } /* JRS - Use the congestion control given in the CC module */ asoc->cc_functions.sctp_cwnd_update_after_fr(stcb, asoc); @@ -5615,6 +5621,10 @@ again: done_once = 1; goto again; } + /* Fix up the a-p-a-p for future PR-SCTP sends */ + if (compare_with_wrap(cum_ack, asoc->advanced_peer_ack_point, MAX_TSN)) { + asoc->advanced_peer_ack_point = cum_ack; + } /* C2. try to further move advancedPeerAckPoint ahead */ if ((asoc->peer_supports_prsctp) && (asoc->pr_sctp_cnt > 0)) { struct sctp_tmit_chunk *lchk; diff --git a/sys/netinet/sctp_os_bsd.h b/sys/netinet/sctp_os_bsd.h index 468fcce..949f118 100644 --- a/sys/netinet/sctp_os_bsd.h +++ b/sys/netinet/sctp_os_bsd.h @@ -196,7 +196,7 @@ MALLOC_DECLARE(SCTP_M_SOCKOPT); #define SCTP_PRINTF(params...) printf(params) #ifdef SCTP_LTRACE_CHUNKS -#define SCTP_LTRACE_CHK(a, b, c, d) if(SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_LTRACE_CHUNK_ENABLE) CTR6(KTR_SUBSYS, "SCTP:%d[%d]:%x-%x-%x-%x", SCTP_LOG_CHUNK_PROC, 0, a, b, c, d) +#define SCTP_LTRACE_CHK(a, b, c, d) if(SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_LTRACE_CHUNK_ENABLE) SCTP_CTR6(KTR_SUBSYS, "SCTP:%d[%d]:%x-%x-%x-%x", SCTP_LOG_CHUNK_PROC, 0, a, b, c, d) #else #define SCTP_LTRACE_CHK(a, b, c, d) #endif |