]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/blobdiff - net/sctp/transport.c
scripts/spelling.txt: add "varible" pattern and fix typo instances
[mirror_ubuntu-artful-kernel.git] / net / sctp / transport.c
index a1652ab63918940be605eaf002b5506f5e4e6673..3379668af3686de2ec14db980b1ef527a6d1045f 100644 (file)
@@ -88,9 +88,11 @@ static struct sctp_transport *sctp_transport_init(struct net *net,
        INIT_LIST_HEAD(&peer->transports);
 
        setup_timer(&peer->T3_rtx_timer, sctp_generate_t3_rtx_event,
-                       (unsigned long)peer);
+                   (unsigned long)peer);
        setup_timer(&peer->hb_timer, sctp_generate_heartbeat_event,
-                       (unsigned long)peer);
+                   (unsigned long)peer);
+       setup_timer(&peer->reconf_timer, sctp_generate_reconf_event,
+                   (unsigned long)peer);
        setup_timer(&peer->proto_unreach_timer,
                    sctp_generate_proto_unreach_event, (unsigned long)peer);
 
@@ -144,6 +146,9 @@ void sctp_transport_free(struct sctp_transport *transport)
        if (del_timer(&transport->T3_rtx_timer))
                sctp_transport_put(transport);
 
+       if (del_timer(&transport->reconf_timer))
+               sctp_transport_put(transport);
+
        /* Delete the ICMP proto unreachable timer if it's active. */
        if (del_timer(&transport->proto_unreach_timer))
                sctp_association_put(transport->asoc);
@@ -211,6 +216,14 @@ void sctp_transport_reset_hb_timer(struct sctp_transport *transport)
                sctp_transport_hold(transport);
 }
 
+void sctp_transport_reset_reconf_timer(struct sctp_transport *transport)
+{
+       if (!timer_pending(&transport->reconf_timer))
+               if (!mod_timer(&transport->reconf_timer,
+                              jiffies + transport->rto))
+                       sctp_transport_hold(transport);
+}
+
 /* This transport has been assigned to an association.
  * Initialize fields from the association or from the sock itself.
  * Register the reference count in the association.
@@ -227,7 +240,7 @@ void sctp_transport_pmtu(struct sctp_transport *transport, struct sock *sk)
 {
        /* If we don't have a fresh route, look one up */
        if (!transport->dst || transport->dst->obsolete) {
-               dst_release(transport->dst);
+               sctp_transport_dst_release(transport);
                transport->af_specific->get_dst(transport, &transport->saddr,
                                                &transport->fl, sk);
        }
@@ -630,9 +643,7 @@ void sctp_transport_reset(struct sctp_transport *t)
        t->srtt = 0;
        t->rttvar = 0;
 
-       /* Reset these additional varibles so that we have a clean
-        * slate.
-        */
+       /* Reset these additional variables so that we have a clean slate. */
        t->partial_bytes_acked = 0;
        t->flight_size = 0;
        t->error_count = 0;
@@ -659,3 +670,17 @@ void sctp_transport_immediate_rtx(struct sctp_transport *t)
                        sctp_transport_hold(t);
        }
 }
+
+/* Drop dst */
+void sctp_transport_dst_release(struct sctp_transport *t)
+{
+       dst_release(t->dst);
+       t->dst = NULL;
+       t->dst_pending_confirm = 0;
+}
+
+/* Schedule neighbour confirm */
+void sctp_transport_dst_confirm(struct sctp_transport *t)
+{
+       t->dst_pending_confirm = 1;
+}