aboutsummaryrefslogtreecommitdiff
path: root/sys/netinet/sctp_timer.c
diff options
context:
space:
mode:
authorRandall Stewart <rrs@FreeBSD.org>2006-12-14 17:02:55 +0000
committerRandall Stewart <rrs@FreeBSD.org>2006-12-14 17:02:55 +0000
commita5d547add3475cbba521b738f99e366f187bedf1 (patch)
tree940611c208a2462c47614c0688becd97244ad6fe /sys/netinet/sctp_timer.c
parente0ccd04489940f08680d14c8c443e884542fb4f1 (diff)
Notes
Diffstat (limited to 'sys/netinet/sctp_timer.c')
-rw-r--r--sys/netinet/sctp_timer.c31
1 files changed, 26 insertions, 5 deletions
diff --git a/sys/netinet/sctp_timer.c b/sys/netinet/sctp_timer.c
index 6ac0b7faba9f..dc55ef66ffaa 100644
--- a/sys/netinet/sctp_timer.c
+++ b/sys/netinet/sctp_timer.c
@@ -324,8 +324,9 @@ sctp_threshold_management(struct sctp_inpcb *inp, struct sctp_tcb *stcb,
ph->param_type = htons(SCTP_CAUSE_PROTOCOL_VIOLATION);
ph->param_length = htons(oper->m_len);
ippp = (uint32_t *) (ph + 1);
- *ippp = htonl(0x40000001);
+ *ippp = htonl(SCTP_FROM_SCTP_TIMER + SCTP_LOC_1);
}
+ inp->last_abort_code = SCTP_FROM_SCTP_TIMER + SCTP_LOC_1;
sctp_abort_an_association(inp, stcb, SCTP_FAILED_THRESHOLD, oper);
return (1);
}
@@ -681,7 +682,19 @@ sctp_mark_all_for_resend(struct sctp_tcb *stcb,
stcb->asoc.total_flight_count--;
chk->sent = SCTP_DATAGRAM_RESEND;
SCTP_STAT_INCR(sctps_markedretrans);
- net->flight_size -= chk->book_size;
+#ifdef SCTP_FLIGHT_LOGGING
+ sctp_misc_ints(SCTP_FLIGHT_LOG_DOWN,
+ chk->whoTo->flight_size,
+ chk->book_size,
+ (uintptr_t) stcb,
+ chk->rec.data.TSN_seq);
+#endif
+
+ if (net->flight_size >= chk->book_size)
+ net->flight_size -= chk->book_size;
+ else
+ net->flight_size = 0;
+
stcb->asoc.peers_rwnd += chk->send_size;
stcb->asoc.peers_rwnd += sctp_peer_chunk_oh;
@@ -747,7 +760,7 @@ sctp_mark_all_for_resend(struct sctp_tcb *stcb,
could_be_sent->sent = SCTP_DATAGRAM_RESEND;
}
if (stcb->asoc.sent_queue_retran_cnt != cnt_mk) {
-#ifdef INVARIENTS
+#ifdef INVARIANTS
printf("Local Audit says there are %d for retran asoc cnt:%d\n",
cnt_mk, stcb->asoc.sent_queue_retran_cnt);
#endif
@@ -789,6 +802,13 @@ sctp_mark_all_for_resend(struct sctp_tcb *stcb,
}
TAILQ_FOREACH(chk, &stcb->asoc.sent_queue, sctp_next) {
if (chk->sent < SCTP_DATAGRAM_RESEND) {
+#ifdef SCTP_FLIGHT_LOGGING
+ sctp_misc_ints(SCTP_FLIGHT_LOG_UP,
+ chk->whoTo->flight_size,
+ chk->book_size,
+ (uintptr_t) stcb,
+ chk->rec.data.TSN_seq);
+#endif
stcb->asoc.total_flight += chk->book_size;
chk->whoTo->flight_size += chk->book_size;
stcb->asoc.total_flight_count++;
@@ -1077,12 +1097,13 @@ sctp_cookie_timer(struct sctp_inpcb *inp,
ph->param_type = htons(SCTP_CAUSE_PROTOCOL_VIOLATION);
ph->param_length = htons(oper->m_len);
ippp = (uint32_t *) (ph + 1);
- *ippp = htonl(0x40000002);
+ *ippp = htonl(SCTP_FROM_SCTP_TIMER + SCTP_LOC_2);
}
+ inp->last_abort_code = SCTP_FROM_SCTP_TIMER + SCTP_LOC_3;
sctp_abort_an_association(inp, stcb, SCTP_INTERNAL_ERROR,
oper);
} else {
-#ifdef INVARIENTS
+#ifdef INVARIANTS
panic("Cookie timer expires in wrong state?");
#else
printf("Strange in state %d not cookie-echoed yet c-e timer expires?\n", SCTP_GET_STATE(&stcb->asoc));