diff options
author | rrs <rrs@FreeBSD.org> | 2007-07-14 09:36:28 +0000 |
---|---|---|
committer | rrs <rrs@FreeBSD.org> | 2007-07-14 09:36:28 +0000 |
commit | 1e9af2c480a638933876e637c1f3b9f1b7bad3e9 (patch) | |
tree | 008308315d74a9df2eec618692844a82f1ace245 /sys/netinet/sctp_var.h | |
parent | 0948603d9eefb8b7f5898f99c8703b2e5b7f9647 (diff) | |
download | FreeBSD-src-1e9af2c480a638933876e637c1f3b9f1b7bad3e9.zip FreeBSD-src-1e9af2c480a638933876e637c1f3b9f1b7bad3e9.tar.gz |
- Modular congestion control, with RFC2581 being the default.
- CMT_PF states added (w/sysctl to turn the PF version on)
- sctp_input.c had a missing incr of cookie case when the
auth was bad. This meant a free was called without an
increment to refcnt, added increment like rest of code.
- There was a case, unlikely, when the scope of the destination
changed (this is a TSNH case). In that case, it would not free
the alloc'ed asoc (in sctp_input.c).
- When listed addresses found a colliding cookie/Init, then
the collided upon tcb was not unlocked in sctp_pcb.c
- Add error checking on arguments of sctp_sendx(3) to prevent it from
referencing a NULL pointer.
- Fix an error return of sctp_sendx(3), it was returing
ENOMEM not -1.
- Get assoc id was changed to use the sanctified socket api
method for getting a assoc id (PEER_ADDR_INFO instead of
PEER_ADDR_PARAMS).
- Fix it so a peeled off socket will get a proper error return
if it trys to send to a different address then it is connected to.
- Fix so that select_a_stream can avoid an endless loop that
could hang a caller.
- time_entered (state set time) was not being set in all cases
to the time we went established.
Approved by: re(ken smith)
Diffstat (limited to 'sys/netinet/sctp_var.h')
-rw-r--r-- | sys/netinet/sctp_var.h | 47 |
1 files changed, 31 insertions, 16 deletions
diff --git a/sys/netinet/sctp_var.h b/sys/netinet/sctp_var.h index f05a368..b6e1d06 100644 --- a/sys/netinet/sctp_var.h +++ b/sys/netinet/sctp_var.h @@ -90,6 +90,7 @@ extern struct pr_usrreqs sctp_usrreqs; #define sctp_free_a_chunk(_stcb, _chk) { \ + SCTP_TCB_LOCK_ASSERT((_stcb)); \ if ((_chk)->whoTo) { \ sctp_free_remote_addr((_chk)->whoTo); \ (_chk)->whoTo = NULL; \ @@ -223,7 +224,6 @@ extern struct pr_usrreqs sctp_usrreqs; } \ } while (0) -#ifdef RANDY_WILL_USE_LATER /* this will be the non-invarant version */ #define sctp_flight_size_decrease(tp1) do { \ if (tp1->whoTo->flight_size >= tp1->book_size) \ tp1->whoTo->flight_size -= tp1->book_size; \ @@ -231,8 +231,21 @@ extern struct pr_usrreqs sctp_usrreqs; tp1->whoTo->flight_size = 0; \ } while (0) +#define sctp_flight_size_increase(tp1) do { \ + (tp1)->whoTo->flight_size += (tp1)->book_size; \ +} while (0) +#ifdef SCTP_FS_SPEC_LOG #define sctp_total_flight_decrease(stcb, tp1) do { \ + if(stcb->asoc.fs_index > SCTP_FS_SPEC_LOG_SIZE) \ + stcb->asoc.fs_index = 0;\ + stcb->asoc.fslog[stcb->asoc.fs_index].total_flight = stcb->asoc.total_flight; \ + stcb->asoc.fslog[stcb->asoc.fs_index].tsn = tp1->rec.data.TSN_seq; \ + stcb->asoc.fslog[stcb->asoc.fs_index].book = tp1->book_size; \ + stcb->asoc.fslog[stcb->asoc.fs_index].sent = tp1->sent; \ + stcb->asoc.fslog[stcb->asoc.fs_index].incr = 0; \ + stcb->asoc.fslog[stcb->asoc.fs_index].decr = 1; \ + stcb->asoc.fs_index++; \ if (stcb->asoc.total_flight >= tp1->book_size) { \ stcb->asoc.total_flight -= tp1->book_size; \ if (stcb->asoc.total_flight_count > 0) \ @@ -243,15 +256,21 @@ extern struct pr_usrreqs sctp_usrreqs; } \ } while (0) -#else - -#define sctp_flight_size_decrease(tp1) do { \ - if (tp1->whoTo->flight_size >= tp1->book_size) \ - tp1->whoTo->flight_size -= tp1->book_size; \ - else \ - panic("flight size corruption"); \ +#define sctp_total_flight_increase(stcb, tp1) do { \ + if(stcb->asoc.fs_index > SCTP_FS_SPEC_LOG_SIZE) \ + stcb->asoc.fs_index = 0;\ + stcb->asoc.fslog[stcb->asoc.fs_index].total_flight = stcb->asoc.total_flight; \ + stcb->asoc.fslog[stcb->asoc.fs_index].tsn = tp1->rec.data.TSN_seq; \ + stcb->asoc.fslog[stcb->asoc.fs_index].book = tp1->book_size; \ + stcb->asoc.fslog[stcb->asoc.fs_index].sent = tp1->sent; \ + stcb->asoc.fslog[stcb->asoc.fs_index].incr = 1; \ + stcb->asoc.fslog[stcb->asoc.fs_index].decr = 0; \ + stcb->asoc.fs_index++; \ + (stcb)->asoc.total_flight_count++; \ + (stcb)->asoc.total_flight += (tp1)->book_size; \ } while (0) +#else #define sctp_total_flight_decrease(stcb, tp1) do { \ if (stcb->asoc.total_flight >= tp1->book_size) { \ @@ -259,22 +278,18 @@ extern struct pr_usrreqs sctp_usrreqs; if (stcb->asoc.total_flight_count > 0) \ stcb->asoc.total_flight_count--; \ } else { \ - panic("total flight size corruption"); \ + stcb->asoc.total_flight = 0; \ + stcb->asoc.total_flight_count = 0; \ } \ } while (0) -#endif - -#define sctp_flight_size_increase(tp1) do { \ - (tp1)->whoTo->flight_size += (tp1)->book_size; \ -} while (0) - - #define sctp_total_flight_increase(stcb, tp1) do { \ (stcb)->asoc.total_flight_count++; \ (stcb)->asoc.total_flight += (tp1)->book_size; \ } while (0) +#endif + struct sctp_nets; struct sctp_inpcb; struct sctp_tcb; |