sctp: add stream reconf timer
This patch is to add a per transport timer based on sctp timer frame for stream reconf chunk retransmission. It would start after sending a reconf request chunk, and stop after receiving the response chunk. If the timer expires, besides retransmitting the reconf request chunk, it would also do the same thing with data RTO timer. like to increase the appropriate error counts, and perform threshold management, possibly destroying the asoc if sctp retransmission thresholds are exceeded, just as section 5.1.1 describes. This patch is also to add asoc strreset_chunk, it is used to save the reconf request chunk, so that it can be retransmitted, and to check if the response is really for this request by comparing the information inside with the response chunk as well. Signed-off-by: Xin Long <lucien.xin@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:

committed by
David S. Miller

parent
cc16f00f65
commit
7b9438de0c
@@ -1021,6 +1021,34 @@ sctp_disposition_t sctp_sf_sendbeat_8_3(struct net *net,
|
||||
return SCTP_DISPOSITION_CONSUME;
|
||||
}
|
||||
|
||||
/* resend asoc strreset_chunk. */
|
||||
sctp_disposition_t sctp_sf_send_reconf(struct net *net,
|
||||
const struct sctp_endpoint *ep,
|
||||
const struct sctp_association *asoc,
|
||||
const sctp_subtype_t type, void *arg,
|
||||
sctp_cmd_seq_t *commands)
|
||||
{
|
||||
struct sctp_transport *transport = arg;
|
||||
|
||||
if (asoc->overall_error_count >= asoc->max_retrans) {
|
||||
sctp_add_cmd_sf(commands, SCTP_CMD_SET_SK_ERR,
|
||||
SCTP_ERROR(ETIMEDOUT));
|
||||
/* CMD_ASSOC_FAILED calls CMD_DELETE_TCB. */
|
||||
sctp_add_cmd_sf(commands, SCTP_CMD_ASSOC_FAILED,
|
||||
SCTP_PERR(SCTP_ERROR_NO_ERROR));
|
||||
SCTP_INC_STATS(net, SCTP_MIB_ABORTEDS);
|
||||
SCTP_DEC_STATS(net, SCTP_MIB_CURRESTAB);
|
||||
return SCTP_DISPOSITION_DELETE_TCB;
|
||||
}
|
||||
|
||||
sctp_chunk_hold(asoc->strreset_chunk);
|
||||
sctp_add_cmd_sf(commands, SCTP_CMD_REPLY,
|
||||
SCTP_CHUNK(asoc->strreset_chunk));
|
||||
sctp_add_cmd_sf(commands, SCTP_CMD_STRIKE, SCTP_TRANSPORT(transport));
|
||||
|
||||
return SCTP_DISPOSITION_CONSUME;
|
||||
}
|
||||
|
||||
/*
|
||||
* Process an heartbeat request.
|
||||
*
|
||||
|
Reference in New Issue
Block a user