linux 2.6.16.38 w/ vs2.0.3-rc1
[linux-2.6.git] / net / sctp / sm_sideeffect.c
index c5beb2a..8d1dc24 100644 (file)
@@ -498,6 +498,10 @@ static void sctp_cmd_assoc_failed(sctp_cmd_seq_t *commands,
        sctp_add_cmd_sf(commands, SCTP_CMD_NEW_STATE,
                        SCTP_STATE(SCTP_STATE_CLOSED));
 
+       /* Set sk_err to ECONNRESET on a 1-1 style socket. */
+       if (!sctp_style(asoc->base.sk, UDP))
+               asoc->base.sk->sk_err = ECONNRESET; 
+
        /* SEND_FAILED sent later when cleaning up the association. */
        asoc->outqueue.error = error;
        sctp_add_cmd_sf(commands, SCTP_CMD_DELETE_TCB, SCTP_NULL());
@@ -834,15 +838,6 @@ static void sctp_cmd_del_non_primary(struct sctp_association *asoc)
        return;
 }
 
-/* Helper function to set sk_err on a 1-1 style socket. */
-static void sctp_cmd_set_sk_err(struct sctp_association *asoc, int error)
-{
-       struct sock *sk = asoc->base.sk;
-
-       if (!sctp_style(sk, UDP))
-               sk->sk_err = error;
-}
-
 /* These three macros allow us to pull the debugging code out of the
  * main flow of sctp_do_sm() to keep attention focused on the real
  * functionality there.
@@ -1463,9 +1458,6 @@ static int sctp_cmd_interpreter(sctp_event_t event_type,
                        local_cork = 0;
                        asoc->peer.retran_path = t;
                        break;
-               case SCTP_CMD_SET_SK_ERR:
-                       sctp_cmd_set_sk_err(asoc, cmd->obj.error);
-                       break;
                default:
                        printk(KERN_WARNING "Impossible command: %u, %p\n",
                               cmd->verb, cmd->obj.ptr);