diff options
author | rrs <rrs@FreeBSD.org> | 2006-11-11 15:59:01 +0000 |
---|---|---|
committer | rrs <rrs@FreeBSD.org> | 2006-11-11 15:59:01 +0000 |
commit | e0c50feae8264926c5241ae08542f1f75ef7cc65 (patch) | |
tree | ad54f2c4385045522d51df03b3f6502d25221456 /sys/netinet/sctputil.c | |
parent | 0100d343f488d0d5c2e70c793182caa2fe89fcc0 (diff) | |
download | FreeBSD-src-e0c50feae8264926c5241ae08542f1f75ef7cc65.zip FreeBSD-src-e0c50feae8264926c5241ae08542f1f75ef7cc65.tar.gz |
Turns out we would reset the TSN seq counter during
a colliding INIT. This if fine except when we have
data outstanding... we basically reset it to the
previous value it was.. so then we end up assigning
the same TSN to two different data chunks.
This patch:
1) Finds a missing lock for when we change the stream
numbers during COOKIE and INIT-ACK processing.. we
were NOT locking the send_buffer.. which COULD cause
problems (found by inspection looking for <2>)
2) Fixes a case during a colliding INIT where we incorrectly
reset the sending Sequence thus in some cases duplicately
assigning a TSN.
3) Additional enhancments to logging so we can see strm/tsn in
the receiver AND new tracking to watch what the sender
is doing with TSN and STRM seq's.
Approved by: gnn
Diffstat (limited to 'sys/netinet/sctputil.c')
-rw-r--r-- | sys/netinet/sctputil.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/sys/netinet/sctputil.c b/sys/netinet/sctputil.c index c0d6742..f98a81e 100644 --- a/sys/netinet/sctputil.c +++ b/sys/netinet/sctputil.c @@ -211,7 +211,7 @@ rto_logging(struct sctp_nets *net, int from) } void -sctp_log_strm_del_alt(uint32_t tsn, uint16_t sseq, int from) +sctp_log_strm_del_alt(struct sctp_tcb *stcb, uint32_t tsn, uint16_t sseq, uint16_t stream, int from) { int sctp_cwnd_log_at; @@ -219,10 +219,12 @@ sctp_log_strm_del_alt(uint32_t tsn, uint16_t sseq, int from) sctp_clog[sctp_cwnd_log_at].time_event = sctp_get_time_of_event(); sctp_clog[sctp_cwnd_log_at].from = (uint8_t) from; sctp_clog[sctp_cwnd_log_at].event_type = (uint8_t) SCTP_LOG_EVENT_STRM; + sctp_clog[sctp_cwnd_log_at].x.strlog.stcb = stcb; sctp_clog[sctp_cwnd_log_at].x.strlog.n_tsn = tsn; sctp_clog[sctp_cwnd_log_at].x.strlog.n_sseq = sseq; sctp_clog[sctp_cwnd_log_at].x.strlog.e_tsn = 0; sctp_clog[sctp_cwnd_log_at].x.strlog.e_sseq = 0; + sctp_clog[sctp_cwnd_log_at].x.strlog.strm = stream; } void @@ -325,8 +327,10 @@ sctp_log_strm_del(struct sctp_queued_to_read *control, struct sctp_queued_to_rea sctp_clog[sctp_cwnd_log_at].time_event = sctp_get_time_of_event(); sctp_clog[sctp_cwnd_log_at].from = (uint8_t) from; sctp_clog[sctp_cwnd_log_at].event_type = (uint8_t) SCTP_LOG_EVENT_STRM; + sctp_clog[sctp_cwnd_log_at].x.strlog.stcb = control->stcb; sctp_clog[sctp_cwnd_log_at].x.strlog.n_tsn = control->sinfo_tsn; sctp_clog[sctp_cwnd_log_at].x.strlog.n_sseq = control->sinfo_ssn; + sctp_clog[sctp_cwnd_log_at].x.strlog.strm = control->sinfo_stream; if (poschk != NULL) { sctp_clog[sctp_cwnd_log_at].x.strlog.e_tsn = poschk->sinfo_tsn; sctp_clog[sctp_cwnd_log_at].x.strlog.e_sseq = poschk->sinfo_ssn; |