summaryrefslogtreecommitdiffstats
path: root/sys/netinet/sctp_output.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/netinet/sctp_output.c')
-rw-r--r--sys/netinet/sctp_output.c100
1 files changed, 48 insertions, 52 deletions
diff --git a/sys/netinet/sctp_output.c b/sys/netinet/sctp_output.c
index 21b8f8f..5cde4d0 100644
--- a/sys/netinet/sctp_output.c
+++ b/sys/netinet/sctp_output.c
@@ -4200,7 +4200,7 @@ sctp_send_initiate(struct sctp_inpcb *inp, struct sctp_tcb *stcb, int so_locked
/* place in my tag */
init->init.initiate_tag = htonl(stcb->asoc.my_vtag);
/* set up some of the credits. */
- init->init.a_rwnd = htonl(max(SCTP_SB_LIMIT_RCV(inp->sctp_socket),
+ init->init.a_rwnd = htonl(max(inp->sctp_socket ? SCTP_SB_LIMIT_RCV(inp->sctp_socket) : 0,
SCTP_MINIMAL_RWND));
init->init.num_outbound_streams = htons(stcb->asoc.pre_open_streams);
@@ -4411,7 +4411,6 @@ sctp_send_initiate(struct sctp_inpcb *inp, struct sctp_tcb *stcb, int so_locked
net->port, so_locked, NULL);
SCTPDBG(SCTP_DEBUG_OUTPUT4, "lowlevel_output - %d\n", ret);
SCTP_STAT_INCR_COUNTER64(sctps_outcontrolchunks);
- sctp_timer_start(SCTP_TIMER_TYPE_INIT, inp, stcb, net);
(void)SCTP_GETTIME_TIMEVAL(&net->last_sent_time);
}
@@ -5786,61 +5785,58 @@ sctp_get_frag_point(struct sctp_tcb *stcb,
}
static void
-sctp_set_prsctp_policy(struct sctp_tcb *stcb,
- struct sctp_stream_queue_pending *sp)
+sctp_set_prsctp_policy(struct sctp_stream_queue_pending *sp)
{
sp->pr_sctp_on = 0;
- if (stcb->asoc.peer_supports_prsctp) {
+ /*
+ * We assume that the user wants PR_SCTP_TTL if the user provides a
+ * positive lifetime but does not specify any PR_SCTP policy. This
+ * is a BAD assumption and causes problems at least with the
+ * U-Vancovers MPI folks. I will change this to be no policy means
+ * NO PR-SCTP.
+ */
+ if (PR_SCTP_ENABLED(sp->sinfo_flags)) {
+ sp->act_flags |= PR_SCTP_POLICY(sp->sinfo_flags);
+ sp->pr_sctp_on = 1;
+ } else {
+ return;
+ }
+ switch (PR_SCTP_POLICY(sp->sinfo_flags)) {
+ case CHUNK_FLAGS_PR_SCTP_BUF:
/*
- * We assume that the user wants PR_SCTP_TTL if the user
- * provides a positive lifetime but does not specify any
- * PR_SCTP policy. This is a BAD assumption and causes
- * problems at least with the U-Vancovers MPI folks. I will
- * change this to be no policy means NO PR-SCTP.
+ * Time to live is a priority stored in tv_sec when doing
+ * the buffer drop thing.
*/
- if (PR_SCTP_ENABLED(sp->sinfo_flags)) {
- sp->act_flags |= PR_SCTP_POLICY(sp->sinfo_flags);
- sp->pr_sctp_on = 1;
- } else {
- return;
- }
- switch (PR_SCTP_POLICY(sp->sinfo_flags)) {
- case CHUNK_FLAGS_PR_SCTP_BUF:
- /*
- * Time to live is a priority stored in tv_sec when
- * doing the buffer drop thing.
- */
- sp->ts.tv_sec = sp->timetolive;
- sp->ts.tv_usec = 0;
- break;
- case CHUNK_FLAGS_PR_SCTP_TTL:
- {
- struct timeval tv;
+ sp->ts.tv_sec = sp->timetolive;
+ sp->ts.tv_usec = 0;
+ break;
+ case CHUNK_FLAGS_PR_SCTP_TTL:
+ {
+ struct timeval tv;
- (void)SCTP_GETTIME_TIMEVAL(&sp->ts);
- tv.tv_sec = sp->timetolive / 1000;
- tv.tv_usec = (sp->timetolive * 1000) % 1000000;
- /*
- * TODO sctp_constants.h needs alternative
- * time macros when _KERNEL is undefined.
- */
- timevaladd(&sp->ts, &tv);
- }
- break;
- case CHUNK_FLAGS_PR_SCTP_RTX:
+ (void)SCTP_GETTIME_TIMEVAL(&sp->ts);
+ tv.tv_sec = sp->timetolive / 1000;
+ tv.tv_usec = (sp->timetolive * 1000) % 1000000;
/*
- * Time to live is a the number or retransmissions
- * stored in tv_sec.
+ * TODO sctp_constants.h needs alternative time
+ * macros when _KERNEL is undefined.
*/
- sp->ts.tv_sec = sp->timetolive;
- sp->ts.tv_usec = 0;
- break;
- default:
- SCTPDBG(SCTP_DEBUG_USRREQ1,
- "Unknown PR_SCTP policy %u.\n",
- PR_SCTP_POLICY(sp->sinfo_flags));
- break;
+ timevaladd(&sp->ts, &tv);
}
+ break;
+ case CHUNK_FLAGS_PR_SCTP_RTX:
+ /*
+ * Time to live is a the number or retransmissions stored in
+ * tv_sec.
+ */
+ sp->ts.tv_sec = sp->timetolive;
+ sp->ts.tv_usec = 0;
+ break;
+ default:
+ SCTPDBG(SCTP_DEBUG_USRREQ1,
+ "Unknown PR_SCTP policy %u.\n",
+ PR_SCTP_POLICY(sp->sinfo_flags));
+ break;
}
}
@@ -5911,7 +5907,7 @@ sctp_msg_append(struct sctp_tcb *stcb,
sp->tail_mbuf = NULL;
sp->length = 0;
at = m;
- sctp_set_prsctp_policy(stcb, sp);
+ sctp_set_prsctp_policy(sp);
/*
* We could in theory (for sendall) sifa the length in, but we would
* still have to hunt through the chain since we need to setup the
@@ -7138,7 +7134,7 @@ dont_do_it:
}
/* We only re-set the policy if it is on */
if (sp->pr_sctp_on) {
- sctp_set_prsctp_policy(stcb, sp);
+ sctp_set_prsctp_policy(sp);
asoc->pr_sctp_cnt++;
chk->pr_sctp_on = 1;
} else {
@@ -12285,7 +12281,7 @@ skip_copy:
sp->addr_over = 0;
}
atomic_add_int(&sp->net->ref_count, 1);
- sctp_set_prsctp_policy(stcb, sp);
+ sctp_set_prsctp_policy(sp);
}
out_now:
return (sp);
OpenPOWER on IntegriCloud