<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugzilla.yoctoproject.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.6"
          urlbase="https://bugzilla.yoctoproject.org/"
          
          maintainer="it-coreprojects-helpdesk@linuxfoundation.org"
>

    <bug>
          <bug_id>4580</bug_id>
          
          <creation_ts>2013-05-31 08:42:22 +0000</creation_ts>
          <short_desc>SCTP association can get stuck in SCTP_STATE_SHUTDOWN_PENDING state forever</short_desc>
          <delta_ts>2014-04-24 03:30:00 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>11</classification_id>
          <classification>Runtime</classification>
          <product>General Runtime</product>
          <component>General Runtime</component>
          <version>unspecified</version>
          <rep_platform>x86</rep_platform>
          <op_sys>Multiple</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>Medium</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>1.5</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Xufeng Zhang">xufeng.zhang</reporter>
          <assigned_to name="Xufeng Zhang">xufeng.zhang</assigned_to>
          <cc>sgw</cc>
          
          
          <cf_os>---</cf_os>
          <cf_regression_type>---</cf_regression_type>
          
          <cf_docchange>No (bug/feature does not impact docs)</cf_docchange>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>33429</commentid>
    <comment_count>0</comment_count>
    <who name="Xufeng Zhang">xufeng.zhang</who>
    <bug_when>2013-05-31 08:42:22 +0000</bug_when>
    <thetext>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 &amp;

#### 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 (&quot;Recieved SCTP_COMM_LOST&quot;)
#### 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 &lt;ENTER&gt; 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&gt; snd=5
10.19.205.32:60001-10.19.206.46:60001 Interactive mode&gt; snd=5
10.19.205.32:60001-10.19.206.46:60001 Interactive mode&gt; 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 &lt;-&gt; 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 &lt;-&gt; *10.19.206.46             30000    10    10    5    0    0        7</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>42961</commentid>
    <comment_count>1</comment_count>
    <who name="Xufeng Zhang">xufeng.zhang</who>
    <bug_when>2014-04-24 03:30:00 +0000</bug_when>
    <thetext>This fix has already been merged.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>