summaryrefslogtreecommitdiffstats
path: root/sys/netinet/sctp_input.c
diff options
context:
space:
mode:
authortuexen <tuexen@FreeBSD.org>2010-08-28 17:59:51 +0000
committertuexen <tuexen@FreeBSD.org>2010-08-28 17:59:51 +0000
commit8d90bd696f6ffe32185cc58c210e1cb2b6b40466 (patch)
tree3c18fb8c6c88a9d89b4532f1a0b0ed84a8db9c07 /sys/netinet/sctp_input.c
parent9d21e17f07e784c9d5c0c2ed6a0a0c75431f76eb (diff)
downloadFreeBSD-src-8d90bd696f6ffe32185cc58c210e1cb2b6b40466.zip
FreeBSD-src-8d90bd696f6ffe32185cc58c210e1cb2b6b40466.tar.gz
Fix the switching on/off of CMT using sysctl and socket option.
Fix the switching on/off of PF and NR-SACKs using sysctl. Add minor improvement in handling malloc failures. Improve the address checks when sending. MFC after: 4 weeks
Diffstat (limited to 'sys/netinet/sctp_input.c')
-rw-r--r--sys/netinet/sctp_input.c28
1 files changed, 12 insertions, 16 deletions
diff --git a/sys/netinet/sctp_input.c b/sys/netinet/sctp_input.c
index 8b2a9d5..089c9b6 100644
--- a/sys/netinet/sctp_input.c
+++ b/sys/netinet/sctp_input.c
@@ -618,16 +618,16 @@ sctp_handle_heartbeat_ack(struct sctp_heartbeat_chunk *cp,
* timer is running, for the destination, stop the timer because a
* PF-heartbeat was received.
*/
- if (SCTP_BASE_SYSCTL(sctp_cmt_on_off) &&
- SCTP_BASE_SYSCTL(sctp_cmt_pf) &&
- (net->dest_state & SCTP_ADDR_PF) == SCTP_ADDR_PF) {
+ if ((stcb->asoc.sctp_cmt_on_off == 1) &&
+ (stcb->asoc.sctp_cmt_pf > 0) &&
+ ((net->dest_state & SCTP_ADDR_PF) == SCTP_ADDR_PF)) {
if (SCTP_OS_TIMER_PENDING(&net->rxt_timer.timer)) {
sctp_timer_stop(SCTP_TIMER_TYPE_SEND, stcb->sctp_ep,
stcb, net,
SCTP_FROM_SCTP_INPUT + SCTP_LOC_5);
}
net->dest_state &= ~SCTP_ADDR_PF;
- net->cwnd = net->mtu * SCTP_BASE_SYSCTL(sctp_cmt_pf);
+ net->cwnd = net->mtu * stcb->asoc.sctp_cmt_pf;
SCTPDBG(SCTP_DEBUG_INPUT1, "Destination %p moved from PF to reachable with cwnd %d.\n",
net, net->cwnd);
}
@@ -2723,6 +2723,7 @@ sctp_handle_cookie_echo(struct mbuf *m, int iphlen, int offset,
inp->sctp_mobility_features = (*inp_p)->sctp_mobility_features;
inp->sctp_socket = so;
inp->sctp_frag_point = (*inp_p)->sctp_frag_point;
+ inp->sctp_cmt_on_off = (*inp_p)->sctp_cmt_on_off;
inp->partial_delivery_point = (*inp_p)->partial_delivery_point;
inp->sctp_context = (*inp_p)->sctp_context;
inp->inp_starting_point_for_iterator = NULL;
@@ -3067,7 +3068,7 @@ process_chunk_drop(struct sctp_tcb *stcb, struct sctp_chunk_desc *desc,
struct sctp_nets *net, uint8_t flg)
{
switch (desc->chunk_type) {
- case SCTP_DATA:
+ case SCTP_DATA:
/* find the tsn to resend (possibly */
{
uint32_t tsn;
@@ -4586,8 +4587,6 @@ process_control_chunks:
return (NULL);
break;
case SCTP_SELECTIVE_ACK:
- SCTPDBG(SCTP_DEBUG_INPUT3, "SCTP_SACK\n");
- SCTP_STAT_INCR(sctps_recvsacks);
{
struct sctp_sack_chunk *sack;
int abort_now = 0;
@@ -4597,6 +4596,8 @@ process_control_chunks:
int offset_seg, offset_dup;
int nonce_sum_flag;
+ SCTPDBG(SCTP_DEBUG_INPUT3, "SCTP_SACK\n");
+ SCTP_STAT_INCR(sctps_recvsacks);
if (stcb == NULL) {
SCTPDBG(SCTP_DEBUG_INDATA1, "No stcb when processing SACK chunk\n");
break;
@@ -4673,8 +4674,6 @@ process_control_chunks:
* nr_sack chunk
*/
case SCTP_NR_SELECTIVE_ACK:
- SCTPDBG(SCTP_DEBUG_INPUT3, "SCTP_NR_SACK\n");
- SCTP_STAT_INCR(sctps_recvsacks);
{
struct sctp_nr_sack_chunk *nr_sack;
int abort_now = 0;
@@ -4684,13 +4683,10 @@ process_control_chunks:
int offset_seg, offset_dup;
int nonce_sum_flag;
- /*
- * EY nr_sacks have not been negotiated but
- * the peer end sent an nr_sack, silently
- * discard the chunk
- */
- if (!(SCTP_BASE_SYSCTL(sctp_nr_sack_on_off) &&
- stcb->asoc.peer_supports_nr_sack)) {
+ SCTPDBG(SCTP_DEBUG_INPUT3, "SCTP_NR_SACK\n");
+ SCTP_STAT_INCR(sctps_recvsacks);
+ if ((stcb->asoc.sctp_nr_sack_on_off == 0) ||
+ (stcb->asoc.peer_supports_nr_sack == 0)) {
goto unknown_chunk;
}
if (stcb == NULL) {
OpenPOWER on IntegriCloud