Commit 0b58a811 authored by Vlad Yasevich's avatar Vlad Yasevich Committed by David S. Miller

[SCTP]: Clean up stale data during association restart

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: default avatarVlad Yasevich <vladislav.yasevich@hp.com>
Signed-off-by: default avatarSridhar Samudrala <sri@us.ibm.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent c577c2b9
...@@ -59,6 +59,7 @@ struct sctp_ulpq { ...@@ -59,6 +59,7 @@ struct sctp_ulpq {
/* Prototypes. */ /* Prototypes. */
struct sctp_ulpq *sctp_ulpq_init(struct sctp_ulpq *, struct sctp_ulpq *sctp_ulpq_init(struct sctp_ulpq *,
struct sctp_association *); struct sctp_association *);
void sctp_ulpq_flush(struct sctp_ulpq *ulpq);
void sctp_ulpq_free(struct sctp_ulpq *); void sctp_ulpq_free(struct sctp_ulpq *);
/* Add a new DATA chunk for processing. */ /* Add a new DATA chunk for processing. */
......
...@@ -1063,6 +1063,12 @@ void sctp_assoc_update(struct sctp_association *asoc, ...@@ -1063,6 +1063,12 @@ void sctp_assoc_update(struct sctp_association *asoc,
*/ */
sctp_ssnmap_clear(asoc->ssnmap); 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 { } else {
/* Add any peer addresses from the new association. */ /* Add any peer addresses from the new association. */
list_for_each(pos, &new->peer.transport_addr_list) { list_for_each(pos, &new->peer.transport_addr_list) {
......
...@@ -73,7 +73,7 @@ struct sctp_ulpq *sctp_ulpq_init(struct sctp_ulpq *ulpq, ...@@ -73,7 +73,7 @@ struct sctp_ulpq *sctp_ulpq_init(struct sctp_ulpq *ulpq,
/* Flush the reassembly and ordering queues. */ /* 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 sk_buff *skb;
struct sctp_ulpevent *event; struct sctp_ulpevent *event;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment