SCTP: Handle a COOKIE ECHO/ACK when a TCB Exists

This patch addresses the requirements depicted in section 5.2.4 of the
RFC 4960. It also takes care of handling the ERROR chunk and obviously
the STALE COOKIE error.

Change-Id: I6b88a9371546b18a52abac22f7c593a5f16be838
Signed-off-by: Marco Varlese <marco.varlese@suse.com>
diff --git a/src/vnet/sctp/sctp.c b/src/vnet/sctp/sctp.c
index 046eb18..20f23f2 100644
--- a/src/vnet/sctp/sctp.c
+++ b/src/vnet/sctp/sctp.c
@@ -417,24 +417,16 @@
 				&sctp_conn->sub_conn[i].connection.lcl_ip,
 				sctp_conn->sub_conn[i].connection.lcl_port);
 
-  /* Check if connection is not yet fully established */
-  if (sctp_conn->state == SCTP_STATE_COOKIE_WAIT)
-    {
+  int thread_index =
+    sctp_conn->sub_conn[MAIN_SCTP_SUB_CONN_IDX].connection.thread_index;
 
-    }
-  else
-    {
-      int thread_index =
-	sctp_conn->sub_conn[MAIN_SCTP_SUB_CONN_IDX].connection.thread_index;
+  /* Make sure all timers are cleared */
+  sctp_connection_timers_reset (sctp_conn);
 
-      /* Make sure all timers are cleared */
-      sctp_connection_timers_reset (sctp_conn);
-
-      /* Poison the entry */
-      if (CLIB_DEBUG > 0)
-	memset (sctp_conn, 0xFA, sizeof (*sctp_conn));
-      pool_put (tm->connections[thread_index], sctp_conn);
-    }
+  /* Poison the entry */
+  if (CLIB_DEBUG > 0)
+    memset (sctp_conn, 0xFA, sizeof (*sctp_conn));
+  pool_put (tm->connections[thread_index], sctp_conn);
 }
 
 int