| Summary: |
SCTP association can get stuck in SCTP_STATE_SHUTDOWN_PENDING state forever |
| Product: |
[Runtime] General Runtime
|
Reporter: |
Xufeng Zhang <xufeng.zhang> |
| Component: |
General Runtime | Assignee: |
Xufeng Zhang <xufeng.zhang> |
| Status: |
RESOLVED
FIXED
|
QA Contact: |
|
| Severity: |
normal
|
|
|
| Priority: |
Medium
|
CC: |
sgw
|
| Version: |
unspecified | |
|
| Target Milestone: |
1.5 | |
|
| Hardware: |
x86 | |
|
| OS: |
Multiple | |
|
| Whiteboard: |
|
|
OS type for building Yocto:
|
---
|
Type of Regression:
|
---
|
|
Verified:
|
|
Documentation change:
|
No (bug/feature does not impact docs)
|
SCTP association can get stuck in SCTP_STATE_SHUTDOWN_PENDING state forever by running the below test case: #### Accept SCTP traffic on port 60001 iptables -t filter -I INPUT 3 -p sctp --dport 60001 -j ACCEPT iptables -t filter -I OUTPUT 3 -p sctp --dport 60001 -j ACCEPT #### SCTP parameters on A (slow detection of link failure) net.sctp.association_max_retrans = 5 net.sctp.path_max_retrans = 5 net.sctp.hb_interval = 30000 #### SCTP parameters on B (fast detection of link failure) net.sctp.association_max_retrans = 2 net.sctp.path_max_retrans = 2 net.sctp.hb_interval = 1000 Test Procedure #### First setup SCTP link between two hosts #### Send on A (interactive) sctp_darn -H 10.19.205.32 -P 60001 -h 10.19.206.46 -p 60001 -I -s #### Listen on B sctp_darn -H 10.19.206.46 -P 60001 -h 10.19.205.32 -p 60001 -l & #### Send on A to establish the SCTP association. snd=5 #### Ensure the SCTP association is up on B cat /proc/net/sctp/assocs #### Block SCTP on B (simulates a network failure) iptables -t filter -I INPUT 1 -p sctp --dport 60001 -j DROP iptables -t filter -I OUTPUT 1 -p sctp --dport 60001 -j DROP #### Quickly send data on A and then shutdown (A goes into SHUTDOWN_PENDING state) snd=5 snd=5 shutdown #### Wait for link to drop on B ("Recieved SCTP_COMM_LOST") #### Quickly kill the listener, open the firewall for SCTP, then start an SCTP sender kill $PROC_TO_KILL iptables -t filter -D INPUT 1 iptables -t filter -D OUTPUT 1 sctp_darn -H 10.19.206.46 -P 60001 -h 10.19.205.32 -p 60001 -s #### Press <ENTER> to send data to trigger sending INITs to A #### Host A receives a RESTART indication and gives up on the SHUTDOWN 10.19.205.32:60001-10.19.206.46:60001 Interactive mode> snd=5 10.19.205.32:60001-10.19.206.46:60001 Interactive mode> snd=5 10.19.205.32:60001-10.19.206.46:60001 Interactive mode> shutdown Recieved SCTP_RESTART SHUTDOWN failed #### Association on A remains in SHUTDOWN_PENDING (5) state indefinitely cat /proc/net/sctp/assocs ASSOC SOCK STY SST ST HBKT ASSOC-ID TX_QUEUE RX_QUEUE UID INODE LPORT RPORT LADDRS <-> RADDRS HBINT INS OUTS MAXRT T1X T2X RTXC d7190000 e3171180 0 7 5 35723 1 0 0 0 0 60001 60001 *10.19.205.32 <-> *10.19.206.46 30000 10 10 5 0 0 7