aboutsummaryrefslogtreecommitdiff
path: root/sys/netinet/sctp_output.c
diff options
context:
space:
mode:
authorRandall Stewart <rrs@FreeBSD.org>2010-06-05 21:27:43 +0000
committerRandall Stewart <rrs@FreeBSD.org>2010-06-05 21:27:43 +0000
commitaca14c2aa859c30d696879e9e1bde3cf87f2f961 (patch)
tree45038a1731ee0823e9cd5f6f139778696d58b5de /sys/netinet/sctp_output.c
parent791437b51c56f20cc295577d1dc60e9d4d8ead52 (diff)
downloadsrc-aca14c2aa859c30d696879e9e1bde3cf87f2f961.tar.gz
src-aca14c2aa859c30d696879e9e1bde3cf87f2f961.zip
This change does the following:
1) Fix the alignment of a comment. 2) Fix a BUG where we were NOT paying attention to the RESEND marking on retransmitting control chunks.. and worse we were not decrementing the retran count that could cause us to loop forever. 3) Add in the valdiate_no_lock function on invariants so that we will really check all ways out to be sure a lock does not slip out locked. MFC after: 1 week.
Notes
Notes: svn path=/head/; revision=208855
Diffstat (limited to 'sys/netinet/sctp_output.c')
-rw-r--r--sys/netinet/sctp_output.c36
1 files changed, 23 insertions, 13 deletions
diff --git a/sys/netinet/sctp_output.c b/sys/netinet/sctp_output.c
index 96a45754bb1d..011842f45bb3 100644
--- a/sys/netinet/sctp_output.c
+++ b/sys/netinet/sctp_output.c
@@ -3053,32 +3053,32 @@ sctp_source_address_selection(struct sctp_inpcb *inp,
* it out
* zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz
* For V4
- *------------------------------------------
+ * ------------------------------------------
* source * dest * result
* -----------------------------------------
* <a> Private * Global * NAT
* -----------------------------------------
* <b> Private * Private * No problem
* -----------------------------------------
- * <c> Global * Private * Huh, How will this work?
+ * <c> Global * Private * Huh, How will this work?
* -----------------------------------------
- * <d> Global * Global * No Problem
- *------------------------------------------
+ * <d> Global * Global * No Problem
+ *------------------------------------------
* zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz
* For V6
- *------------------------------------------
+ *------------------------------------------
* source * dest * result
* -----------------------------------------
* <a> Linklocal * Global *
* -----------------------------------------
* <b> Linklocal * Linklocal * No problem
* -----------------------------------------
- * <c> Global * Linklocal * Huh, How will this work?
+ * <c> Global * Linklocal * Huh, How will this work?
* -----------------------------------------
- * <d> Global * Global * No Problem
- *------------------------------------------
+ * <d> Global * Global * No Problem
+ *------------------------------------------
* zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz
- *
+ *
* And then we add to that what happens if there are multiple addresses
* assigned to an interface. Remember the ifa on a ifn is a linked
* list of addresses. So one interface can have more than one IP
@@ -3091,13 +3091,13 @@ sctp_source_address_selection(struct sctp_inpcb *inp,
* Decisions:
*
* - count the number of addresses on the interface.
- * - if it is one, no problem except case <c>.
- * For <a> we will assume a NAT out there.
+ * - if it is one, no problem except case <c>.
+ * For <a> we will assume a NAT out there.
* - if there are more than one, then we need to worry about scope P
* or G. We should prefer G -> G and P -> P if possible.
* Then as a secondary fall back to mixed types G->P being a last
* ditch one.
- * - The above all works for bound all, but bound specific we need to
+ * - The above all works for bound all, but bound specific we need to
* use the same concept but instead only consider the bound
* addresses. If the bound set is NOT assigned to the interface then
* we must use rotation amongst the bound addresses..
@@ -8913,6 +8913,9 @@ sctp_chunk_retransmission(struct sctp_inpcb *inp,
if ((chk->rec.chunk_id.id == SCTP_COOKIE_ECHO) ||
(chk->rec.chunk_id.id == SCTP_STREAM_RESET) ||
(chk->rec.chunk_id.id == SCTP_FORWARD_CUM_TSN)) {
+ if (chk->sent != SCTP_DATAGRAM_RESEND) {
+ continue;
+ }
if (chk->rec.chunk_id.id == SCTP_STREAM_RESET) {
if (chk != asoc->str_reset) {
/*
@@ -8973,7 +8976,7 @@ sctp_chunk_retransmission(struct sctp_inpcb *inp,
/* (void)SCTP_GETTIME_TIMEVAL(&chk->whoTo->last_sent_time); */
*cnt_out += 1;
chk->sent = SCTP_DATAGRAM_SENT;
- /* sctp_ucount_decr(asoc->sent_queue_retran_cnt); */
+ sctp_ucount_decr(stcb->asoc.sent_queue_retran_cnt);
if (fwd_tsn == 0) {
return (0);
} else {
@@ -13427,6 +13430,13 @@ out_unlocked:
}
}
#endif
+#ifdef INVARIANTS
+ if (inp) {
+ sctp_validate_no_locks(inp);
+ } else {
+ printf("Warning - inp is NULL so cant validate locks\n");
+ }
+#endif
if (top) {
sctp_m_freem(top);
}