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.
This commit is contained in:
parent
791437b51c
commit
aca14c2aa8
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=208855
@ -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 {
|
||||
@ -13426,6 +13429,13 @@ sctp_lower_sosend(struct socket *so,
|
||||
panic("Leaving with tcb send mtx owned?");
|
||||
}
|
||||
}
|
||||
#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);
|
||||
|
Loading…
Reference in New Issue
Block a user