]> nv-tegra.nvidia Code Review - linux-2.6.git/commitdiff
[SCTP]: Clean up stale data during association restart
authorVlad Yasevich <vladislav.yasevich@hp.com>
Tue, 20 Mar 2007 00:01:17 +0000 (17:01 -0700)
committerDavid S. Miller <davem@sunset.davemloft.net>
Tue, 20 Mar 2007 07:09:43 +0000 (00:09 -0700)
During association restart we may have stale data sitting
on the ULP queue waiting for ordering or reassembly.  This
data may cause severe problems if not cleaned up.  In particular
stale data pending ordering may cause problems with receive
window exhaustion if our peer has decided to restart the
association.

Signed-off-by: Vlad Yasevich <vladislav.yasevich@hp.com>
Signed-off-by: Sridhar Samudrala <sri@us.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/net/sctp/ulpqueue.h
net/sctp/associola.c
net/sctp/ulpqueue.c

index a43c8788b650597d5a607ae66e20d57d69d6af15..ab26ab3adae1bc711a521abc6cbe6b2dfb8a7772 100644 (file)
@@ -59,6 +59,7 @@ struct sctp_ulpq {
 /* Prototypes. */
 struct sctp_ulpq *sctp_ulpq_init(struct sctp_ulpq *,
                                 struct sctp_association *);
+void sctp_ulpq_flush(struct sctp_ulpq *ulpq);
 void sctp_ulpq_free(struct sctp_ulpq *);
 
 /* Add a new DATA chunk for processing. */
index fa82b73c965bc17dadc5ecbaf90bd2f3dae06f21..2505cd3b8d291fe1f6ed0ef97a1419f9ec7c7a12 100644 (file)
@@ -1063,6 +1063,12 @@ void sctp_assoc_update(struct sctp_association *asoc,
                 */
                sctp_ssnmap_clear(asoc->ssnmap);
 
+               /* Flush the ULP reassembly and ordered queue.
+                * Any data there will now be stale and will
+                * cause problems.
+                */
+               sctp_ulpq_flush(&asoc->ulpq);
+
        } else {
                /* Add any peer addresses from the new association. */
                list_for_each(pos, &new->peer.transport_addr_list) {
index f4759a9bdaee5d52c21850928c132e4dc7ecf523..bfb197e37da3784a45c168bf9f87204e717e810b 100644 (file)
@@ -73,7 +73,7 @@ struct sctp_ulpq *sctp_ulpq_init(struct sctp_ulpq *ulpq,
 
 
 /* Flush the reassembly and ordering queues.  */
-static void sctp_ulpq_flush(struct sctp_ulpq *ulpq)
+void sctp_ulpq_flush(struct sctp_ulpq *ulpq)
 {
        struct sk_buff *skb;
        struct sctp_ulpevent *event;