sctp: fix to choose alternate destination when retransmit
Subsystems (2)
PATCH 1/1 sctp: fix to choose alternate destination when retransmit
RFC 5061 Section 5.1 ASCONF Chunk Procedures said:
B4) Re-transmit the ASCONF Chunk last sent and if possible choose an
alternate destination address (please refer to [RFC4960], Section 6.4.1). An endpoint MUST NOT add new parameters to this chunk; it MUST be the same (including its Sequence Number) as the last ASCONF sent. An endpoint MAY, however, bundle an additional ASCONF with new ASCONF parameters with the next Sequence Number. For details, see Section 5.5.
This patch fix to choose an alternate destination address when re-transmit the ASCONF chunk, with some dup codes cleanup.
--- include/net/sctp/structs.h | 6 ++---- net/sctp/associola.c | 42 +++++++----------------------------------- net/sctp/sm_sideeffect.c | 8 +++++--- 3 files changed, 14 insertions(+), 42 deletions(-)
include/net/sctp/structs.h +2 -4
@@ -1939,10 +1939,8 @@ void sctp_association_free(struct sctp_association *);void sctp_association_put (struct sctp_association *);void sctp_association_hold (struct sctp_association *); -struct sctp_transport *sctp_assoc_choose_init_transport ( -struct sctp_association *); -struct sctp_transport *sctp_assoc_choose_shutdown_transport ( -struct sctp_association *); +struct sctp_transport *sctp_assoc_choose_alter_transport ( +struct sctp_association *,struct sctp_transport *);void sctp_assoc_update_retran_path (struct sctp_association *);struct sctp_transport *sctp_assoc_lookup_paddr (const struct sctp_association *,const union sctp_addr *);
net/sctp/associola.c +7 -35
56 lines not on this page · raw message
net/sctp/sm_sideeffect.c +5 -3
@@ -686,7 +686,8 @@ static void sctp_cmd_setup_t2(sctp_cmd_seq_t *cmds, {struct sctp_transport *t; - t =sctp_assoc_choose_shutdown_transport (asoc); + t =sctp_assoc_choose_alter_transport (asoc, + asoc->shutdown_last_sent_to); asoc->shutdown_last_sent_to = t; asoc->timeouts[SCTP_EVENT_TIMEOUT_T2_SHUTDOWN ] = t->rto; chunk->transport = t;
@@ -777,7 +778,7 @@ static void sctp_cmd_setup_t4(sctp_cmd_seq_t *cmds, {struct sctp_transport *t; - t = asoc->peer.active_path; + t =sctp_assoc_choose_alter_transport (asoc, chunk->transport); asoc->timeouts[SCTP_EVENT_TIMEOUT_T4_RTO ] = t->rto; chunk->transport = t; }
@@ -1379,7 +1380,8 @@ static int sctp_cmd_interpreter(sctp_event_t event_type,case SCTP_CMD_INIT_CHOOSE_TRANSPORT : chunk = cmd->obj.ptr; - t =sctp_assoc_choose_init_transport (asoc); + t =sctp_assoc_choose_alter_transport (asoc, + asoc->init_last_sent_to); asoc->init_last_sent_to = t; chunk->transport = t; t->init_sent_count++;
Signature · 1 line
1.6.0.2.530.g67faa
Vlad Yasevich
AppliedQuoted 10 lines · Wei Yongjun
RFC 5061 Section 5.1 ASCONF Chunk Procedures said:
B4) Re-transmit the ASCONF Chunk last sent and if possible choose an
alternate destination address (please refer to [RFC4960], Section 6.4.1). An endpoint MUST NOT add new parameters to this chunk; it MUST be the same (including its Sequence Number) as the last ASCONF sent. An endpoint MAY, however, bundle an additional ASCONF with new ASCONF parameters with the next Sequence Number. For details, see Section 5.5.
Quoted 4 lines
This patch fix to choose an alternate destination address when re-transmit the ASCONF chunk, with some dup codes cleanup.
Signed-off-by Wei Yongjun <[email protected]>
Thanks, applied.
-vlad