]> git.karo-electronics.de Git - mv-sheeva.git/blobdiff - net/sctp/sm_sideeffect.c
[SCTP]: Update SCTP_PEER_ADDR_PARAMS socket option to the latest api draft.
[mv-sheeva.git] / net / sctp / sm_sideeffect.c
index 823947170a335bac4dd074b654be41fe81a0f2fa..2d7d8a5db2ac5c8c69c793ce1f368e9fb5a756e7 100644 (file)
@@ -157,9 +157,12 @@ static int sctp_gen_sack(struct sctp_association *asoc, int force,
 {
        __u32 ctsn, max_tsn_seen;
        struct sctp_chunk *sack;
+       struct sctp_transport *trans = asoc->peer.last_data_from;
        int error = 0;
 
-       if (force)
+       if (force || 
+           (!trans && (asoc->param_flags & SPP_SACKDELAY_DISABLE)) ||
+           (trans && (trans->param_flags & SPP_SACKDELAY_DISABLE)))
                asoc->peer.sack_needed = 1;
 
        ctsn = sctp_tsnmap_get_ctsn(&asoc->peer.tsn_map);
@@ -189,7 +192,22 @@ static int sctp_gen_sack(struct sctp_association *asoc, int force,
        if (!asoc->peer.sack_needed) {
                /* We will need a SACK for the next packet.  */
                asoc->peer.sack_needed = 1;
-               goto out;
+
+               /* Set the SACK delay timeout based on the
+                * SACK delay for the last transport
+                * data was received from, or the default
+                * for the association.
+                */
+               if (trans)
+                       asoc->timeouts[SCTP_EVENT_TIMEOUT_SACK] = 
+                               trans->sackdelay;
+               else
+                       asoc->timeouts[SCTP_EVENT_TIMEOUT_SACK] = 
+                               asoc->sackdelay;
+
+               /* Restart the SACK timer. */
+               sctp_add_cmd_sf(commands, SCTP_CMD_TIMER_RESTART,
+                               SCTP_TO(SCTP_EVENT_TIMEOUT_SACK));
        } else {
                if (asoc->a_rwnd > asoc->rwnd)
                        asoc->a_rwnd = asoc->rwnd;
@@ -205,7 +223,7 @@ static int sctp_gen_sack(struct sctp_association *asoc, int force,
                sctp_add_cmd_sf(commands, SCTP_CMD_TIMER_STOP,
                                SCTP_TO(SCTP_EVENT_TIMEOUT_SACK));
        }
-out:
+
        return error;
 nomem:
        error = -ENOMEM;
@@ -415,7 +433,7 @@ static void sctp_do_8_2_transport_strike(struct sctp_association *asoc,
        asoc->overall_error_count++;
 
        if (transport->state != SCTP_INACTIVE &&
-           (transport->error_count++ >= transport->max_retrans)) {
+           (transport->error_count++ >= transport->pathmaxrxt)) {
                SCTP_DEBUG_PRINTK_IPADDR("transport_strike:association %p",
                                         " transport IP: port:%d failed.\n",
                                         asoc,