l2tp: purge session reorder queue on delete
authorTom Parkin <tparkin@katalix.com>
Tue, 19 Mar 2013 06:11:20 +0000 (06:11 +0000)
committerDavid S. Miller <davem@davemloft.net>
Wed, 20 Mar 2013 16:10:39 +0000 (12:10 -0400)
Add calls to l2tp_session_queue_purge as a part of l2tp_tunnel_closeall
and l2tp_session_delete.  Pseudowire implementations which are deleted only
via. l2tp_core l2tp_session_delete calls can dispense with their own code for
flushing the reorder queue.

Signed-off-by: Tom Parkin <tparkin@katalix.com>
Signed-off-by: James Chapman <jchapman@katalix.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/l2tp/l2tp_core.c

index 69c316dd02dc790f5d18813e4106a50fa496c27e..c00f31b8cc04ff7b7a9f004e750c58e3c103da5d 100644 (file)
@@ -1373,6 +1373,8 @@ again:
                                synchronize_rcu();
                        }
 
+                       l2tp_session_queue_purge(session);
+
                        if (session->session_close != NULL)
                                (*session->session_close)(session);
 
@@ -1813,6 +1815,8 @@ EXPORT_SYMBOL_GPL(l2tp_session_free);
  */
 int l2tp_session_delete(struct l2tp_session *session)
 {
+       l2tp_session_queue_purge(session);
+
        if (session->session_close != NULL)
                (*session->session_close)(session);