History

sctp: add SCTP_ADDR_POTENTIALLY_FAILED notification

SCTP Quick failover draft section 5.1, point 5 has been removed from rfc7829. Instead, "the sender SHOULD (i) notify the Upper Layer Protocol (ULP) about this state transition", as said in section 3.2, point 8. So this patch is to add SCTP_ADDR_POTENTIALLY_FAILED, defined in section 7.1, "which is reported if the affected address becomes PF". Also remove transport cwnd's update when moving from PF back to ACTIVE , which is no longer in rfc7829 either. Note that ulp_notify will be set to false if asoc->expose is not 'enabled', according to last patch. v2->v3: - define SCTP_ADDR_PF SCTP_ADDR_POTENTIALLY_FAILED. v3->v4: - initialize spc_state with SCTP_ADDR_AVAILABLE, as Marcelo suggested. - check asoc->pf_expose in sctp_assoc_control_transport(), as Marcelo suggested.

Xin Long committed 7 years ago

Commit 768e1511 parent aef587b2 files · +16 −18Browse files

Unified · Split

2 files
  1. include/uapi/linux/sctp.h +2 −0
  2. net/sctp/associola.c +14 −18
include/uapi/linux/sctp.h+2−0
@@ -410,6 +410,8 @@ enum sctp_spc_state { · 409 unmodified lines
410410 SCTP_ADDR_ADDED,
411411 SCTP_ADDR_MADE_PRIM,
412412 SCTP_ADDR_CONFIRMED,
413+ SCTP_ADDR_POTENTIALLY_FAILED,
414+#define SCTP_ADDR_PF SCTP_ADDR_POTENTIALLY_FAILED
413415 };
414416
415417
net/sctp/associola.c+14−18
@@ -787,8 +787,8 @@ void sctp_assoc_control_transport(struct sctp_association *asoc, · 786 unmodified lines
787787 enum sctp_transport_cmd command,
788788 sctp_sn_error_t error)
789789 {
790+ int spc_state = SCTP_ADDR_AVAILABLE;
790791 bool ulp_notify = true;
791− int spc_state = 0;
792792
793793 /* Record the transition on the transport. */
794794 switch (command) {
@@ -797,19 +797,13 @@ void sctp_assoc_control_transport(struct sctp_association *asoc, · 2 unmodified lines
797797 * to heartbeat success, report the SCTP_ADDR_CONFIRMED
798798 * state to the user, otherwise report SCTP_ADDR_AVAILABLE.
799799 */
800− if (SCTP_UNCONFIRMED == transport->state &&
801− SCTP_HEARTBEAT_SUCCESS == error)
802− spc_state = SCTP_ADDR_CONFIRMED;
803− else
804− spc_state = SCTP_ADDR_AVAILABLE;
805− /* Don't inform ULP about transition from PF to
806− * active state and set cwnd to 1 MTU, see SCTP
807− * Quick failover draft section 5.1, point 5
808− */
809− if (transport->state == SCTP_PF) {
800+ if (transport->state == SCTP_PF &&
801+ asoc->pf_expose != SCTP_PF_EXPOSE_ENABLE)
810802 ulp_notify = false;
811− transport->cwnd = asoc->pathmtu;
812− }
803+ else if (transport->state == SCTP_UNCONFIRMED &&
804+ error == SCTP_HEARTBEAT_SUCCESS)
805+ spc_state = SCTP_ADDR_CONFIRMED;
806+
813807 transport->state = SCTP_ACTIVE;
814808 break;
815809
@@ -818,19 +812,21 @@ void sctp_assoc_control_transport(struct sctp_association *asoc, · 2 unmodified lines
818812 * to inactive state. Also, release the cached route since
819813 * there may be a better route next time.
820814 */
821− if (transport->state != SCTP_UNCONFIRMED)
815+ if (transport->state != SCTP_UNCONFIRMED) {
822816 transport->state = SCTP_INACTIVE;
823− else {
817+ spc_state = SCTP_ADDR_UNREACHABLE;
818+ } else {
824819 sctp_transport_dst_release(transport);
825820 ulp_notify = false;
826821 }
827−
828− spc_state = SCTP_ADDR_UNREACHABLE;
829822 break;
830823
831824 case SCTP_TRANSPORT_PF:
832825 transport->state = SCTP_PF;
833− ulp_notify = false;
826+ if (asoc->pf_expose != SCTP_PF_EXPOSE_ENABLE)
827+ ulp_notify = false;
828+ else
829+ spc_state = SCTP_ADDR_POTENTIALLY_FAILED;
834830 break;
835831
836832 default:

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t