aboutsummaryrefslogtreecommitdiff
path: root/sys/netinet/sctp_indata.c
diff options
context:
space:
mode:
authorMichael Tuexen <tuexen@FreeBSD.org>2018-07-19 19:33:42 +0000
committerMichael Tuexen <tuexen@FreeBSD.org>2018-07-19 19:33:42 +0000
commit7679e49dd436fb975c3c0e4815cdbcb52c024c7c (patch)
tree72a9c0ff94c6b0a1f8d2339186fc594ab00cf5f9 /sys/netinet/sctp_indata.c
parente2b89ca9cb5f126f082d29ea5b50890250a0e5fd (diff)
Notes
Diffstat (limited to 'sys/netinet/sctp_indata.c')
-rw-r--r--sys/netinet/sctp_indata.c112
1 files changed, 65 insertions, 47 deletions
diff --git a/sys/netinet/sctp_indata.c b/sys/netinet/sctp_indata.c
index dbc2aa549015b..794dbd33d58cb 100644
--- a/sys/netinet/sctp_indata.c
+++ b/sys/netinet/sctp_indata.c
@@ -77,8 +77,7 @@ sctp_set_rwnd(struct sctp_tcb *stcb, struct sctp_association *asoc)
/* Calculate what the rwnd would be */
uint32_t
-sctp_calc_rwnd(struct sctp_tcb *stcb, struct sctp_association *asoc)
-{
+sctp_calc_rwnd(struct sctp_tcb *stcb, struct sctp_association *asoc){
uint32_t calc = 0;
/*
@@ -90,6 +89,7 @@ sctp_calc_rwnd(struct sctp_tcb *stcb, struct sctp_association *asoc)
if (stcb->sctp_socket == NULL) {
return (calc);
}
+
KASSERT(asoc->cnt_on_reasm_queue > 0 || asoc->size_on_reasm_queue == 0,
("size_on_reasm_queue is %u", asoc->size_on_reasm_queue));
KASSERT(asoc->cnt_on_all_streams > 0 || asoc->size_on_all_streams == 0,
@@ -102,19 +102,20 @@ sctp_calc_rwnd(struct sctp_tcb *stcb, struct sctp_association *asoc)
return (calc);
}
/* get actual space */
- calc = (uint32_t)sctp_sbspace(&stcb->asoc, &stcb->sctp_socket->so_rcv);
+ calc = (uint32_t) sctp_sbspace(&stcb->asoc, &stcb->sctp_socket->so_rcv);
/*
* take out what has NOT been put on socket queue and we yet hold
* for putting up.
*/
- calc = sctp_sbspace_sub(calc, (uint32_t)(asoc->size_on_reasm_queue +
+ calc = sctp_sbspace_sub(calc, (uint32_t) (asoc->size_on_reasm_queue +
asoc->cnt_on_reasm_queue * MSIZE));
- calc = sctp_sbspace_sub(calc, (uint32_t)(asoc->size_on_all_streams +
+ calc = sctp_sbspace_sub(calc, (uint32_t) (asoc->size_on_all_streams +
asoc->cnt_on_all_streams * MSIZE));
if (calc == 0) {
/* out of space */
return (calc);
}
+
/* what is the overhead of all these rwnd's */
calc = sctp_sbspace_sub(calc, stcb->asoc.my_rwnd_control_len);
/*
@@ -185,6 +186,7 @@ sctp_build_ctl_nchunk(struct sctp_inpcb *inp, struct sctp_sndrcvinfo *sinfo)
/* user does not want any ancillary data */
return (NULL);
}
+
len = 0;
if (sctp_is_feature_on(inp, SCTP_PCB_FLAGS_RECVRCVINFO)) {
len += CMSG_SPACE(sizeof(struct sctp_rcvinfo));
@@ -443,7 +445,7 @@ sctp_abort_in_reasm(struct sctp_tcb *stcb,
chk->rec.data.tsn,
chk->rec.data.sid,
chk->rec.data.fsn,
- (uint16_t)chk->rec.data.mid);
+ (uint16_t) chk->rec.data.mid);
}
oper = sctp_generate_cause(SCTP_CAUSE_PROTOCOL_VIOLATION, msg);
sctp_m_freem(chk->data);
@@ -527,10 +529,10 @@ sctp_queue_data_to_stream(struct sctp_tcb *stcb,
control->sinfo_stream, control->mid);
} else {
snprintf(msg, sizeof(msg), "Delivered SSN=%4.4x, got TSN=%8.8x, SID=%4.4x, SSN=%4.4x",
- (uint16_t)strm->last_mid_delivered,
+ (uint16_t) strm->last_mid_delivered,
control->sinfo_tsn,
control->sinfo_stream,
- (uint16_t)control->mid);
+ (uint16_t) control->mid);
}
op_err = sctp_generate_cause(SCTP_CAUSE_PROTOCOL_VIOLATION, msg);
stcb->sctp_ep->last_abort_code = SCTP_FROM_SCTP_INDATA + SCTP_LOC_2;
@@ -693,7 +695,7 @@ sctp_setup_tail_pointer(struct sctp_queued_to_read *control)
}
static void
-sctp_add_to_tail_pointer(struct sctp_queued_to_read *control, struct mbuf *m, uint32_t *added)
+sctp_add_to_tail_pointer(struct sctp_queued_to_read *control, struct mbuf *m, uint32_t * added)
{
struct mbuf *prev = NULL;
struct sctp_tcb *stcb;
@@ -1044,6 +1046,7 @@ place_chunk:
SCTP_FROM_SCTP_INDATA + SCTP_LOC_5);
return;
}
+
}
if (inserted == 0) {
/* Its at the end */
@@ -1283,8 +1286,7 @@ uint32_t
sctp_add_chk_to_control(struct sctp_queued_to_read *control,
struct sctp_stream_in *strm,
struct sctp_tcb *stcb, struct sctp_association *asoc,
- struct sctp_tmit_chunk *chk, int hold_rlock)
-{
+ struct sctp_tmit_chunk *chk, int hold_rlock){
/*
* Given a control and a chunk, merge the data from the chk onto the
* control and free up the chunk resources.
@@ -1668,7 +1670,7 @@ sctp_find_reasm_entry(struct sctp_stream_in *strm, uint32_t mid, int ordered, in
static int
sctp_process_a_data_chunk(struct sctp_tcb *stcb, struct sctp_association *asoc,
struct mbuf **m, int offset, int chk_length,
- struct sctp_nets *net, uint32_t *high_tsn, int *abort_flag,
+ struct sctp_nets *net, uint32_t * high_tsn, int *abort_flag,
int *break_flag, int last_chunk, uint8_t chk_type)
{
struct sctp_tmit_chunk *chk = NULL; /* make gcc happy */
@@ -1691,7 +1693,7 @@ sctp_process_a_data_chunk(struct sctp_tcb *stcb, struct sctp_association *asoc,
struct sctp_idata_chunk *chunk, chunk_buf;
chunk = (struct sctp_idata_chunk *)sctp_m_getptr(*m, offset,
- sizeof(struct sctp_idata_chunk), (uint8_t *)&chunk_buf);
+ sizeof(struct sctp_idata_chunk), (uint8_t *) & chunk_buf);
chk_flags = chunk->ch.chunk_flags;
clen = sizeof(struct sctp_idata_chunk);
tsn = ntohl(chunk->dp.tsn);
@@ -1708,12 +1710,12 @@ sctp_process_a_data_chunk(struct sctp_tcb *stcb, struct sctp_association *asoc,
struct sctp_data_chunk *chunk, chunk_buf;
chunk = (struct sctp_data_chunk *)sctp_m_getptr(*m, offset,
- sizeof(struct sctp_data_chunk), (uint8_t *)&chunk_buf);
+ sizeof(struct sctp_data_chunk), (uint8_t *) & chunk_buf);
chk_flags = chunk->ch.chunk_flags;
clen = sizeof(struct sctp_data_chunk);
tsn = ntohl(chunk->dp.tsn);
sid = ntohs(chunk->dp.sid);
- mid = (uint32_t)(ntohs(chunk->dp.ssn));
+ mid = (uint32_t) (ntohs(chunk->dp.ssn));
fsn = tsn;
ppid = chunk->dp.ppid;
}
@@ -1755,7 +1757,7 @@ sctp_process_a_data_chunk(struct sctp_tcb *stcb, struct sctp_association *asoc,
/* Can't hold the bit in the mapping at max array, toss it */
return (0);
}
- if (gap >= (uint32_t)(asoc->mapping_array_size << 3)) {
+ if (gap >= (uint32_t) (asoc->mapping_array_size << 3)) {
SCTP_TCB_LOCK_ASSERT(stcb);
if (sctp_expand_mapping_array(asoc, gap)) {
/* Can't expand, drop it */
@@ -2003,10 +2005,10 @@ sctp_process_a_data_chunk(struct sctp_tcb *stcb, struct sctp_association *asoc,
mid);
} else {
snprintf(msg, sizeof(msg), "Delivered SSN=%4.4x, got TSN=%8.8x, SID=%4.4x, SSN=%4.4x",
- (uint16_t)asoc->strmin[sid].last_mid_delivered,
+ (uint16_t) asoc->strmin[sid].last_mid_delivered,
tsn,
sid,
- (uint16_t)mid);
+ (uint16_t) mid);
}
op_err = sctp_generate_cause(SCTP_CAUSE_PROTOCOL_VIOLATION, msg);
stcb->sctp_ep->last_abort_code = SCTP_FROM_SCTP_INDATA + SCTP_LOC_16;
@@ -2138,6 +2140,7 @@ sctp_process_a_data_chunk(struct sctp_tcb *stcb, struct sctp_association *asoc,
control = NULL;
goto finish_express_del;
}
+
/* Now will we need a chunk too? */
if ((chk_flags & SCTP_DATA_NOT_FRAG) != SCTP_DATA_NOT_FRAG) {
sctp_alloc_a_chunk(stcb, chk);
@@ -2502,8 +2505,8 @@ sctp_slide_mapping_arrays(struct sctp_tcb *stcb)
if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_MAP_LOGGING_ENABLE) {
sctp_log_map(old_base, old_cumack, old_highest,
SCTP_MAP_PREPARE_SLIDE);
- sctp_log_map((uint32_t)slide_from, (uint32_t)slide_end,
- (uint32_t)lgap, SCTP_MAP_SLIDE_FROM);
+ sctp_log_map((uint32_t) slide_from, (uint32_t) slide_end,
+ (uint32_t) lgap, SCTP_MAP_SLIDE_FROM);
}
if (distance + slide_from > asoc->mapping_array_size ||
distance < 0) {
@@ -2515,8 +2518,8 @@ sctp_slide_mapping_arrays(struct sctp_tcb *stcb)
*/
if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_MAP_LOGGING_ENABLE) {
- sctp_log_map((uint32_t)distance, (uint32_t)slide_from,
- (uint32_t)asoc->mapping_array_size,
+ sctp_log_map((uint32_t) distance, (uint32_t) slide_from,
+ (uint32_t) asoc->mapping_array_size,
SCTP_MAP_SLIDE_NONE);
}
} else {
@@ -2642,7 +2645,7 @@ sctp_sack_check(struct sctp_tcb *stcb, int was_a_gap)
int
sctp_process_data(struct mbuf **mm, int iphlen, int *offset, int length,
struct sctp_inpcb *inp, struct sctp_tcb *stcb,
- struct sctp_nets *net, uint32_t *high_tsn)
+ struct sctp_nets *net, uint32_t * high_tsn)
{
struct sctp_chunkhdr *ch, chunk_buf;
struct sctp_association *asoc;
@@ -2705,7 +2708,7 @@ sctp_process_data(struct mbuf **mm, int iphlen, int *offset, int length,
/* get pointer to the first chunk header */
ch = (struct sctp_chunkhdr *)sctp_m_getptr(m, *offset,
sizeof(struct sctp_chunkhdr),
- (uint8_t *)&chunk_buf);
+ (uint8_t *) & chunk_buf);
if (ch == NULL) {
return (1);
}
@@ -2869,7 +2872,7 @@ sctp_process_data(struct mbuf **mm, int iphlen, int *offset, int length,
if (op_err != NULL) {
cause = mtod(op_err, struct sctp_gen_error_cause *);
cause->code = htons(SCTP_CAUSE_UNRECOG_CHUNK);
- cause->length = htons((uint16_t)(chk_length + sizeof(struct sctp_gen_error_cause)));
+ cause->length = htons((uint16_t) (chk_length + sizeof(struct sctp_gen_error_cause)));
SCTP_BUF_LEN(op_err) = sizeof(struct sctp_gen_error_cause);
SCTP_BUF_NEXT(op_err) = SCTP_M_COPYM(m, *offset, chk_length, M_NOWAIT);
if (SCTP_BUF_NEXT(op_err) != NULL) {
@@ -2895,7 +2898,7 @@ sctp_process_data(struct mbuf **mm, int iphlen, int *offset, int length,
}
ch = (struct sctp_chunkhdr *)sctp_m_getptr(m, *offset,
sizeof(struct sctp_chunkhdr),
- (uint8_t *)&chunk_buf);
+ (uint8_t *) & chunk_buf);
if (ch == NULL) {
*offset = length;
stop_proc = 1;
@@ -2938,8 +2941,8 @@ static int
sctp_process_segment_range(struct sctp_tcb *stcb, struct sctp_tmit_chunk **p_tp1, uint32_t last_tsn,
uint16_t frag_strt, uint16_t frag_end, int nr_sacking,
int *num_frs,
- uint32_t *biggest_newly_acked_tsn,
- uint32_t *this_sack_lowest_newack,
+ uint32_t * biggest_newly_acked_tsn,
+ uint32_t * this_sack_lowest_newack,
int *rto_ok)
{
struct sctp_tmit_chunk *tp1;
@@ -3060,7 +3063,7 @@ sctp_process_segment_range(struct sctp_tcb *stcb, struct sctp_tmit_chunk **p_tp1
sctp_misc_ints(SCTP_FLIGHT_LOG_DOWN_GAP,
tp1->whoTo->flight_size,
tp1->book_size,
- (uint32_t)(uintptr_t)tp1->whoTo,
+ (uint32_t) (uintptr_t) tp1->whoTo,
tp1->rec.data.tsn);
}
sctp_flight_size_decrease(tp1);
@@ -3096,6 +3099,7 @@ sctp_process_segment_range(struct sctp_tcb *stcb, struct sctp_tmit_chunk **p_tp1
tp1->do_rtt = 0;
}
}
+
}
if (tp1->sent <= SCTP_DATAGRAM_RESEND) {
if (SCTP_TSN_GT(tp1->rec.data.tsn,
@@ -3176,8 +3180,8 @@ sctp_process_segment_range(struct sctp_tcb *stcb, struct sctp_tmit_chunk **p_tp1
static int
sctp_handle_segments(struct mbuf *m, int *offset, struct sctp_tcb *stcb, struct sctp_association *asoc,
- uint32_t last_tsn, uint32_t *biggest_tsn_acked,
- uint32_t *biggest_newly_acked_tsn, uint32_t *this_sack_lowest_newack,
+ uint32_t last_tsn, uint32_t * biggest_tsn_acked,
+ uint32_t * biggest_newly_acked_tsn, uint32_t * this_sack_lowest_newack,
int num_seg, int num_nr_seg, int *rto_ok)
{
struct sctp_gap_ack_block *frag, block;
@@ -3198,7 +3202,7 @@ sctp_handle_segments(struct mbuf *m, int *offset, struct sctp_tcb *stcb, struct
tp1 = TAILQ_FIRST(&asoc->sent_queue);
}
frag = (struct sctp_gap_ack_block *)sctp_m_getptr(m, *offset,
- sizeof(struct sctp_gap_ack_block), (uint8_t *)&block);
+ sizeof(struct sctp_gap_ack_block), (uint8_t *) & block);
*offset += sizeof(block);
if (frag == NULL) {
return (chunk_freed);
@@ -3268,7 +3272,7 @@ sctp_check_for_revoked(struct sctp_tcb *stcb,
sctp_misc_ints(SCTP_FLIGHT_LOG_UP_REVOKE,
tp1->whoTo->flight_size,
tp1->book_size,
- (uint32_t)(uintptr_t)tp1->whoTo,
+ (uint32_t) (uintptr_t) tp1->whoTo,
tp1->rec.data.tsn);
}
sctp_flight_size_increase(tp1);
@@ -3361,6 +3365,7 @@ sctp_strike_gap_ack_chunks(struct sctp_tcb *stcb, struct sctp_association *asoc,
continue;
}
}
+
}
if (SCTP_TSN_GT(tp1->rec.data.tsn, asoc->this_sack_highest_gap) &&
!(accum_moved && asoc->fast_retran_loss_recovery)) {
@@ -3585,7 +3590,7 @@ sctp_strike_gap_ack_chunks(struct sctp_tcb *stcb, struct sctp_association *asoc,
sctp_misc_ints(SCTP_FLIGHT_LOG_DOWN_RSND,
(tp1->whoTo ? (tp1->whoTo->flight_size) : 0),
tp1->book_size,
- (uint32_t)(uintptr_t)tp1->whoTo,
+ (uint32_t) (uintptr_t) tp1->whoTo,
tp1->rec.data.tsn);
}
if (tp1->whoTo) {
@@ -3596,6 +3601,7 @@ sctp_strike_gap_ack_chunks(struct sctp_tcb *stcb, struct sctp_association *asoc,
tp1);
}
}
+
if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_LOG_RWND_ENABLE) {
sctp_log_rwnd(SCTP_INCREASE_PEER_RWND,
asoc->peers_rwnd, tp1->send_size, SCTP_BASE_SYSCTL(sctp_peer_chunk_oh));
@@ -3677,6 +3683,7 @@ sctp_strike_gap_ack_chunks(struct sctp_tcb *stcb, struct sctp_association *asoc,
tp1->whoTo->find_pseudo_cumack = 1;
tp1->whoTo->find_rtx_pseudo_cumack = 1;
}
+
} else { /* CMT is OFF */
#ifdef SCTP_FR_TO_ALTERNATE
@@ -3897,7 +3904,7 @@ sctp_window_probe_recovery(struct sctp_tcb *stcb,
sctp_misc_ints(SCTP_FLIGHT_LOG_DWN_WP_FWD,
tp1->whoTo ? tp1->whoTo->flight_size : 0,
tp1->book_size,
- (uint32_t)(uintptr_t)tp1->whoTo,
+ (uint32_t) (uintptr_t) tp1->whoTo,
tp1->rec.data.tsn);
return;
}
@@ -3916,7 +3923,7 @@ sctp_window_probe_recovery(struct sctp_tcb *stcb,
sctp_misc_ints(SCTP_FLIGHT_LOG_DOWN_WP,
tp1->whoTo->flight_size,
tp1->book_size,
- (uint32_t)(uintptr_t)tp1->whoTo,
+ (uint32_t) (uintptr_t) tp1->whoTo,
tp1->rec.data.tsn);
}
}
@@ -3955,7 +3962,7 @@ sctp_express_handle_sack(struct sctp_tcb *stcb, uint32_t cumack,
} else if (asoc->last_acked_seq == cumack) {
/* Window update sack */
asoc->peers_rwnd = sctp_sbspace_sub(rwnd,
- (uint32_t)(asoc->total_flight + (asoc->total_flight_count * SCTP_BASE_SYSCTL(sctp_peer_chunk_oh))));
+ (uint32_t) (asoc->total_flight + (asoc->total_flight_count * SCTP_BASE_SYSCTL(sctp_peer_chunk_oh))));
if (asoc->peers_rwnd < stcb->sctp_ep->sctp_ep.sctp_sws_sender) {
/* SWS sender side engages */
asoc->peers_rwnd = 0;
@@ -3965,6 +3972,7 @@ sctp_express_handle_sack(struct sctp_tcb *stcb, uint32_t cumack,
}
return;
}
+
/* First setup for CC stuff */
TAILQ_FOREACH(net, &asoc->nets, sctp_next) {
if (SCTP_TSN_GT(cumack, net->cwr_window_tsn)) {
@@ -4032,7 +4040,7 @@ sctp_express_handle_sack(struct sctp_tcb *stcb, uint32_t cumack,
sctp_misc_ints(SCTP_FLIGHT_LOG_DOWN_CA,
tp1->whoTo->flight_size,
tp1->book_size,
- (uint32_t)(uintptr_t)tp1->whoTo,
+ (uint32_t) (uintptr_t) tp1->whoTo,
tp1->rec.data.tsn);
}
sctp_flight_size_decrease(tp1);
@@ -4230,9 +4238,10 @@ sctp_express_handle_sack(struct sctp_tcb *stcb, uint32_t cumack,
asoc->total_flight = 0;
asoc->total_flight_count = 0;
}
+
/* RWND update */
asoc->peers_rwnd = sctp_sbspace_sub(rwnd,
- (uint32_t)(asoc->total_flight + (asoc->total_flight_count * SCTP_BASE_SYSCTL(sctp_peer_chunk_oh))));
+ (uint32_t) (asoc->total_flight + (asoc->total_flight_count * SCTP_BASE_SYSCTL(sctp_peer_chunk_oh))));
if (asoc->peers_rwnd < stcb->sctp_ep->sctp_ep.sctp_sws_sender) {
/* SWS sender side engages */
asoc->peers_rwnd = 0;
@@ -4482,6 +4491,7 @@ sctp_handle_sack(struct mbuf *m, int offset_seg, int offset_dup,
sctp_misc_ints(SCTP_SACK_LOG_NORMAL, cum_ack,
rwnd, stcb->asoc.last_acked_seq, stcb->asoc.peers_rwnd);
}
+
old_rwnd = stcb->asoc.peers_rwnd;
if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_THRESHOLD_LOGGING) {
sctp_misc_ints(SCTP_THRESHOLD_CLEAR,
@@ -4505,8 +4515,8 @@ sctp_handle_sack(struct mbuf *m, int offset_seg, int offset_dup,
uint32_t *dupdata, dblock;
for (i = 0; i < num_dup; i++) {
- dupdata = (uint32_t *)sctp_m_getptr(m, offset_dup + i * sizeof(uint32_t),
- sizeof(uint32_t), (uint8_t *)&dblock);
+ dupdata = (uint32_t *) sctp_m_getptr(m, offset_dup + i * sizeof(uint32_t),
+ sizeof(uint32_t), (uint8_t *) & dblock);
if (dupdata == NULL) {
break;
}
@@ -4553,6 +4563,7 @@ hopeless_peer:
/* acking something behind */
return;
}
+
/* update the Rwnd of the peer */
if (TAILQ_EMPTY(&asoc->sent_queue) &&
TAILQ_EMPTY(&asoc->send_queue) &&
@@ -4606,6 +4617,7 @@ hopeless_peer:
if (stcb->asoc.cc_functions.sctp_cwnd_prepare_net_for_sack) {
(*stcb->asoc.cc_functions.sctp_cwnd_prepare_net_for_sack) (stcb, net);
}
+
/*
* CMT: SFR algo (and HTNA) - this_sack_highest_newack has
* to be greater than the cumack. Also reset saw_newack to 0
@@ -4644,7 +4656,7 @@ hopeless_peer:
sctp_misc_ints(SCTP_FLIGHT_LOG_DOWN_CA,
tp1->whoTo->flight_size,
tp1->book_size,
- (uint32_t)(uintptr_t)tp1->whoTo,
+ (uint32_t) (uintptr_t) tp1->whoTo,
tp1->rec.data.tsn);
}
sctp_flight_size_decrease(tp1);
@@ -4841,6 +4853,7 @@ hopeless_peer:
#endif
asoc->total_flight = 0;
}
+
/* sa_ignore NO_NULL_CHK */
if ((wake_him) && (stcb->sctp_socket)) {
#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING)
@@ -4904,7 +4917,7 @@ hopeless_peer:
sctp_misc_ints(SCTP_FLIGHT_LOG_UP_REVOKE,
tp1->whoTo->flight_size,
tp1->book_size,
- (uint32_t)(uintptr_t)tp1->whoTo,
+ (uint32_t) (uintptr_t) tp1->whoTo,
tp1->rec.data.tsn);
}
sctp_flight_size_increase(tp1);
@@ -4945,6 +4958,7 @@ hopeless_peer:
sctp_ulp_notify(SCTP_NOTIFY_INTERFACE_UP, stcb,
0, (void *)net, SCTP_SO_NOT_LOCKED);
}
+
if (net == stcb->asoc.primary_destination) {
if (stcb->asoc.alternate) {
/*
@@ -4955,6 +4969,7 @@ hopeless_peer:
stcb->asoc.alternate = NULL;
}
}
+
if (net->dest_state & SCTP_ADDR_PF) {
net->dest_state &= ~SCTP_ADDR_PF;
sctp_timer_stop(SCTP_TIMER_TYPE_HEARTBEAT,
@@ -4977,6 +4992,7 @@ hopeless_peer:
}
asoc->cc_functions.sctp_cwnd_update_after_sack(stcb, asoc, accum_moved, reneged_all, will_exit_fast_recovery);
}
+
if (TAILQ_EMPTY(&asoc->sent_queue)) {
/* nothing left in-flight */
TAILQ_FOREACH(net, &asoc->nets, sctp_next) {
@@ -4990,6 +5006,7 @@ hopeless_peer:
asoc->total_flight = 0;
asoc->total_flight_count = 0;
}
+
/**********************************/
/* Now what about shutdown issues */
/**********************************/
@@ -5116,7 +5133,7 @@ hopeless_peer:
asoc->peers_rwnd, asoc->total_flight, (asoc->total_flight_count * SCTP_BASE_SYSCTL(sctp_peer_chunk_oh)), a_rwnd);
}
asoc->peers_rwnd = sctp_sbspace_sub(a_rwnd,
- (uint32_t)(asoc->total_flight + (asoc->total_flight_count * SCTP_BASE_SYSCTL(sctp_peer_chunk_oh))));
+ (uint32_t) (asoc->total_flight + (asoc->total_flight_count * SCTP_BASE_SYSCTL(sctp_peer_chunk_oh))));
if (asoc->peers_rwnd < stcb->sctp_ep->sctp_ep.sctp_sws_sender) {
/* SWS sender side engages */
asoc->peers_rwnd = 0;
@@ -5124,6 +5141,7 @@ hopeless_peer:
if (asoc->peers_rwnd > old_rwnd) {
win_probe_recovery = 1;
}
+
/*
* Now we must setup so we have a timer up for anyone with
* outstanding data.
@@ -5645,7 +5663,7 @@ sctp_handle_forward_tsn(struct sctp_tcb *stcb,
if (asoc->idata_supported) {
stseq_m = (struct sctp_strseq_mid *)sctp_m_getptr(m, offset,
sizeof(struct sctp_strseq_mid),
- (uint8_t *)&strseqbuf_m);
+ (uint8_t *) & strseqbuf_m);
offset += sizeof(struct sctp_strseq_mid);
if (stseq_m == NULL) {
break;
@@ -5661,13 +5679,13 @@ sctp_handle_forward_tsn(struct sctp_tcb *stcb,
} else {
stseq = (struct sctp_strseq *)sctp_m_getptr(m, offset,
sizeof(struct sctp_strseq),
- (uint8_t *)&strseqbuf);
+ (uint8_t *) & strseqbuf);
offset += sizeof(struct sctp_strseq);
if (stseq == NULL) {
break;
}
sid = ntohs(stseq->sid);
- mid = (uint32_t)ntohs(stseq->ssn);
+ mid = (uint32_t) ntohs(stseq->ssn);
ordered = 1;
}
/* Convert */