summaryrefslogtreecommitdiffstats
path: root/sys/netinet/sctputil.c
diff options
context:
space:
mode:
authorrrs <rrs@FreeBSD.org>2007-04-14 09:44:09 +0000
committerrrs <rrs@FreeBSD.org>2007-04-14 09:44:09 +0000
commitfb6f6fd9a183da8573afa302e42cdf7684785a7d (patch)
tree083a217af386adf4fcec65b47183061eed4b0685 /sys/netinet/sctputil.c
parent571c5243e40d0546bb093ffb58ebf6e6476cfaba (diff)
downloadFreeBSD-src-fb6f6fd9a183da8573afa302e42cdf7684785a7d.zip
FreeBSD-src-fb6f6fd9a183da8573afa302e42cdf7684785a7d.tar.gz
- fix source address selection when picking an acceptable address
- name change of prefered -> preferred - CMT fast recover code added. - Comment fixes in CMT. - We were not giving a reason of cant_start_asoc per socket api if we failed to get init/or/cookie to bring up an assoc. Change so we don't just give a generic "comm lost" but look at actual states of dying assoc. - change "crc32" arguments to "crc32c" to silence strict/noisy compiler warnings when crc32() is also declared - A few minor tweaks to get the portable stuff truely portable for sctp6_usrreq.c :-D - one-2-one style vrf match problem. - window recovery would leave chks marked for retran during window probes on the sent queue. This would then cause an out-of-order problem and assure that the flight size "problem" would occur. - Solves a flight size logging issue that caused rwnd overruns, flight size off as well as false retransmissions.g - Macroize the up and down of flight size. - Fix a ECNE bug in its counting. - The strict_sacks options was causing aborts when window probing was active, fix to make strict sacks a bit smarter about what the next unsent TSN is. - Fixes a one-2-one wakeup bug found by Martin Kulas. - If-defed out form, Andre's copy routines pending his commit of at least m_last().. need to adjust for 6.2 as well.. since m_last won't exist. Reviewed by: gnn
Diffstat (limited to 'sys/netinet/sctputil.c')
-rw-r--r--sys/netinet/sctputil.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/sys/netinet/sctputil.c b/sys/netinet/sctputil.c
index 977ecef..54aef9f 100644
--- a/sys/netinet/sctputil.c
+++ b/sys/netinet/sctputil.c
@@ -1404,7 +1404,9 @@ sctp_timeout_handler(void *t)
}
tmr->stopped_from = 0xa004;
if (stcb) {
+ atomic_add_int(&stcb->asoc.refcnt, 1);
if (stcb->asoc.state == 0) {
+ atomic_add_int(&stcb->asoc.refcnt, -1);
if (inp) {
SCTP_INP_DECR_REF(inp);
}
@@ -1426,7 +1428,6 @@ sctp_timeout_handler(void *t)
tmr->stopped_from = 0xa006;
if (stcb) {
- atomic_add_int(&stcb->asoc.refcnt, 1);
SCTP_TCB_LOCK(stcb);
atomic_add_int(&stcb->asoc.refcnt, -1);
}
@@ -2706,7 +2707,7 @@ sctp_notify_assoc_change(uint32_t event, struct sctp_tcb *stcb,
*/
if (((stcb->sctp_ep->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) ||
(stcb->sctp_ep->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL)) &&
- (event == SCTP_COMM_LOST)) {
+ ((event == SCTP_COMM_LOST) || (event == SCTP_SHUTDOWN_COMP))) {
if (SCTP_GET_STATE(&stcb->asoc) == SCTP_STATE_COOKIE_WAIT)
stcb->sctp_socket->so_error = ECONNREFUSED;
else
@@ -3270,7 +3271,12 @@ sctp_ulp_notify(uint32_t notification, struct sctp_tcb *stcb,
case SCTP_NOTIFY_STRDATA_ERR:
break;
case SCTP_NOTIFY_ASSOC_ABORTED:
- sctp_notify_assoc_change(SCTP_COMM_LOST, stcb, error, NULL);
+ if ((stcb) && (((stcb->asoc.state & SCTP_STATE_MASK) == SCTP_STATE_COOKIE_WAIT) ||
+ ((stcb->asoc.state & SCTP_STATE_MASK) == SCTP_STATE_COOKIE_ECHOED))) {
+ sctp_notify_assoc_change(SCTP_CANT_STR_ASSOC, stcb, error, NULL);
+ } else {
+ sctp_notify_assoc_change(SCTP_COMM_LOST, stcb, error, NULL);
+ }
break;
case SCTP_NOTIFY_PEER_OPENED_STREAM:
break;
@@ -4488,6 +4494,8 @@ sctp_sorecvmsg(struct socket *so,
if (msg_flags) {
in_flags = *msg_flags;
+ if (in_flags & MSG_PEEK)
+ SCTP_STAT_INCR(sctps_read_peeks);
} else {
in_flags = 0;
}
OpenPOWER on IntegriCloud