diff options
author | rrs <rrs@FreeBSD.org> | 2008-08-28 09:44:07 +0000 |
---|---|---|
committer | rrs <rrs@FreeBSD.org> | 2008-08-28 09:44:07 +0000 |
commit | a97a9f5233562046294f64d3db07ca1c90e63a35 (patch) | |
tree | 4a6ba48264c10107c71cdb81d7b311404516ea68 /sys/netinet/sctp_var.h | |
parent | 8ccd4bd3a18f0d73c17c7096b561febf5d6f93d8 (diff) | |
download | FreeBSD-src-a97a9f5233562046294f64d3db07ca1c90e63a35.zip FreeBSD-src-a97a9f5233562046294f64d3db07ca1c90e63a35.tar.gz |
- Make strict-sacks be the default.
- Change it so that without INVARIANTs there are
no panics in SCTP.
- sctp_timer changes so that we have a recovery mechanism
when the sent list is out of order.
Diffstat (limited to 'sys/netinet/sctp_var.h')
-rw-r--r-- | sys/netinet/sctp_var.h | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/sys/netinet/sctp_var.h b/sys/netinet/sctp_var.h index 77f2ceb..9340c1c 100644 --- a/sys/netinet/sctp_var.h +++ b/sys/netinet/sctp_var.h @@ -160,6 +160,9 @@ extern struct pr_usrreqs sctp_usrreqs; } \ } +#ifdef INVARIANTS + + #define sctp_sbfree(ctl, stcb, sb, m) { \ uint32_t val; \ val = atomic_fetchadd_int(&(sb)->sb_cc,-(SCTP_BUF_LEN((m)))); \ @@ -186,6 +189,35 @@ extern struct pr_usrreqs sctp_usrreqs; } +#else + +#define sctp_sbfree(ctl, stcb, sb, m) { \ + uint32_t val; \ + val = atomic_fetchadd_int(&(sb)->sb_cc,-(SCTP_BUF_LEN((m)))); \ + if (val < SCTP_BUF_LEN((m))) { \ + (sb)->sb_cc = 0;\ + } \ + val = atomic_fetchadd_int(&(sb)->sb_mbcnt,-(MSIZE)); \ + if (val < MSIZE) { \ + (sb)->sb_mbcnt = 0; \ + } \ + if (((ctl)->do_not_ref_stcb == 0) && stcb) {\ + val = atomic_fetchadd_int(&(stcb)->asoc.sb_cc,-(SCTP_BUF_LEN((m)))); \ + if (val < SCTP_BUF_LEN((m))) {\ + (stcb)->asoc.sb_cc = 0; \ + } \ + val = atomic_fetchadd_int(&(stcb)->asoc.my_rwnd_control_len,-(MSIZE)); \ + if (val < MSIZE) { \ + (stcb)->asoc.my_rwnd_control_len = 0; \ + } \ + } \ + if (SCTP_BUF_TYPE(m) != MT_DATA && SCTP_BUF_TYPE(m) != MT_HEADER && \ + SCTP_BUF_TYPE(m) != MT_OOBDATA) \ + atomic_subtract_int(&(sb)->sb_ctl,SCTP_BUF_LEN((m))); \ +} + +#endif + #define sctp_sballoc(stcb, sb, m) { \ atomic_add_int(&(sb)->sb_cc,SCTP_BUF_LEN((m))); \ atomic_add_int(&(sb)->sb_mbcnt, MSIZE); \ |