sctp: Adjust PMTU updates to accomodate route invalidation.
[firefly-linux-kernel-4.4.55.git] / net / sctp / transport.c
index b026ba0c69922e09eb5c150298f650ea7bb3d1c4..e69e1a2175a42d585c0e1b5fbdbc9b1f9ae9601e 100644 (file)
@@ -68,6 +68,8 @@ static struct sctp_transport *sctp_transport_init(struct sctp_transport *peer,
        peer->af_specific = sctp_get_af_specific(addr->sa.sa_family);
        memset(&peer->saddr, 0, sizeof(union sctp_addr));
 
+       peer->sack_generation = 0;
+
        /* From 6.3.1 RTO Calculation:
         *
         * C1) Until an RTT measurement has been made for a packet sent to the
@@ -226,7 +228,7 @@ void sctp_transport_pmtu(struct sctp_transport *transport, struct sock *sk)
                transport->pathmtu = SCTP_DEFAULT_MAXSEGMENT;
 }
 
-void sctp_transport_update_pmtu(struct sctp_transport *t, u32 pmtu)
+void sctp_transport_update_pmtu(struct sock *sk, struct sctp_transport *t, u32 pmtu)
 {
        struct dst_entry *dst;
 
@@ -243,8 +245,16 @@ void sctp_transport_update_pmtu(struct sctp_transport *t, u32 pmtu)
        }
 
        dst = sctp_transport_dst_check(t);
-       if (dst)
+       if (!dst)
+               t->af_specific->get_dst(t, &t->saddr, &t->fl, sk);
+
+       if (dst) {
                dst->ops->update_pmtu(dst, pmtu);
+
+               dst = sctp_transport_dst_check(t);
+               if (!dst)
+                       t->af_specific->get_dst(t, &t->saddr, &t->fl, sk);
+       }
 }
 
 /* Caches the dst entry and source address for a transport's destination