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
410 SCTP_ADDR_ADDED,410 SCTP_ADDR_ADDED,
411 SCTP_ADDR_MADE_PRIM,411 SCTP_ADDR_MADE_PRIM,
412 SCTP_ADDR_CONFIRMED,412 SCTP_ADDR_CONFIRMED,
413 SCTP_ADDR_POTENTIALLY_FAILED,
414#define SCTP_ADDR_PF SCTP_ADDR_POTENTIALLY_FAILED
413};415};
414 416
415 417
net/sctp/associola.c+14−18
@@ -787,8 +787,8 @@ void sctp_assoc_control_transport(struct sctp_association *asoc, · 786 unmodified lines
787 enum sctp_transport_cmd command,787 enum sctp_transport_cmd command,
788 sctp_sn_error_t error)788 sctp_sn_error_t error)
789{789{
790 int spc_state = SCTP_ADDR_AVAILABLE;
790 bool ulp_notify = true;791 bool ulp_notify = true;
791 int spc_state = 0;
792 792
793 /* Record the transition on the transport. */793 /* Record the transition on the transport. */
794 switch (command) {794 switch (command) {
@@ -797,19 +797,13 @@ void sctp_assoc_control_transport(struct sctp_association *asoc, · 2 unmodified lines
797 * to heartbeat success, report the SCTP_ADDR_CONFIRMED797 * to heartbeat success, report the SCTP_ADDR_CONFIRMED
798 * state to the user, otherwise report SCTP_ADDR_AVAILABLE.798 * state to the user, otherwise report SCTP_ADDR_AVAILABLE.
799 */799 */
800 if (SCTP_UNCONFIRMED == transport->state &&800 if (transport->state == SCTP_PF &&
801 SCTP_HEARTBEAT_SUCCESS == error)801 asoc->pf_expose != SCTP_PF_EXPOSE_ENABLE)
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) {
810 ulp_notify = false;802 ulp_notify = false;
811 transport->cwnd = asoc->pathmtu;803 else if (transport->state == SCTP_UNCONFIRMED &&
812 }804 error == SCTP_HEARTBEAT_SUCCESS)
805 spc_state = SCTP_ADDR_CONFIRMED;
806
813 transport->state = SCTP_ACTIVE;807 transport->state = SCTP_ACTIVE;
814 break;808 break;
815 809
@@ -818,19 +812,21 @@ void sctp_assoc_control_transport(struct sctp_association *asoc, · 2 unmodified lines
818 * to inactive state. Also, release the cached route since812 * to inactive state. Also, release the cached route since
819 * there may be a better route next time.813 * there may be a better route next time.
820 */814 */
821 if (transport->state != SCTP_UNCONFIRMED)815 if (transport->state != SCTP_UNCONFIRMED) {
822 transport->state = SCTP_INACTIVE;816 transport->state = SCTP_INACTIVE;
823 else {817 spc_state = SCTP_ADDR_UNREACHABLE;
818 } else {
824 sctp_transport_dst_release(transport);819 sctp_transport_dst_release(transport);
825 ulp_notify = false;820 ulp_notify = false;
826 }821 }
827
828 spc_state = SCTP_ADDR_UNREACHABLE;
829 break;822 break;
830 823
831 case SCTP_TRANSPORT_PF:824 case SCTP_TRANSPORT_PF:
832 transport->state = SCTP_PF;825 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;
834 break;830 break;
835 831
836 default:832 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