sctp: Bundle HEAERTBEAT into ASCONF_ACK
authorMichio Honda <micchie@sfc.wide.ad.jp>
Thu, 16 Jun 2011 08:14:34 +0000 (17:14 +0900)
committerDavid S. Miller <davem@davemloft.net>
Thu, 25 Aug 2011 02:41:13 +0000 (19:41 -0700)
With this patch a HEARTBEAT chunk is bundled into the ASCONF-ACK
for ADD IP ADDRESS, confirming the new destination as quickly as
possible.

Signed-off-by: Michio Honda <micchie@sfc.wide.ad.jp>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/net/sctp/structs.h
net/sctp/associola.c
net/sctp/sm_make_chunk.c
net/sctp/sm_statefuns.c

index f7d9c3fc06fd58dd0742f492bca0f5f11d47b50c..e90e7a9935ddc5c70c8e920487bc1196c2cc49e2 100644 (file)
@@ -1915,6 +1915,7 @@ struct sctp_association {
        __u32 addip_serial;
        union sctp_addr *asconf_addr_del_pending;
        int src_out_of_asoc_ok;
+       struct sctp_transport *new_transport;
 
        /* SCTP AUTH: list of the endpoint shared keys.  These
         * keys are provided out of band by the user applicaton
index dc16b90ddb6f28d66b623fe820a8b457696d5560..152b5b3c3fffa978ae0d725d182f9aa54c8a9cf6 100644 (file)
@@ -282,6 +282,7 @@ static struct sctp_association *sctp_association_init(struct sctp_association *a
                asoc->peer.asconf_capable = 1;
        asoc->asconf_addr_del_pending = NULL;
        asoc->src_out_of_asoc_ok = 0;
+       asoc->new_transport = NULL;
 
        /* Create an input queue.  */
        sctp_inq_init(&asoc->base.inqueue);
index 81db4e3853528071dc29ba88a0ba155e7e2ca7ae..0121e0ab035167d468c2976f17f210b2cb98a083 100644 (file)
@@ -3015,6 +3015,7 @@ static __be16 sctp_process_asconf_param(struct sctp_association *asoc,
                /* Start the heartbeat timer. */
                if (!mod_timer(&peer->hb_timer, sctp_transport_timeout(peer)))
                        sctp_transport_hold(peer);
+               asoc->new_transport = peer;
                break;
        case SCTP_PARAM_DEL_IP:
                /* ADDIP 4.3 D7) If a request is received to delete the
index 49b847b00f9956cc1eea2d5077bdcbff1b3a3285..73d14fc026065b88864a386c56b4ed0f67a3bead 100644 (file)
@@ -3612,6 +3612,11 @@ sctp_disposition_t sctp_sf_do_asconf(const struct sctp_endpoint *ep,
         */
        asconf_ack->dest = chunk->source;
        sctp_add_cmd_sf(commands, SCTP_CMD_REPLY, SCTP_CHUNK(asconf_ack));
+       if (asoc->new_transport) {
+               sctp_sf_heartbeat(ep, asoc, type, asoc->new_transport,
+                    commands);
+               ((struct sctp_association *)asoc)->new_transport = NULL;
+       }
 
        return SCTP_DISPOSITION_CONSUME;
 }