|
@@ -1164,7 +1164,6 @@ EXPORT_SYMBOL_GPL(l2tp_xmit_skb);
|
|
static void l2tp_tunnel_destruct(struct sock *sk)
|
|
static void l2tp_tunnel_destruct(struct sock *sk)
|
|
{
|
|
{
|
|
struct l2tp_tunnel *tunnel = l2tp_tunnel(sk);
|
|
struct l2tp_tunnel *tunnel = l2tp_tunnel(sk);
|
|
- struct l2tp_net *pn;
|
|
|
|
|
|
|
|
if (tunnel == NULL)
|
|
if (tunnel == NULL)
|
|
goto end;
|
|
goto end;
|
|
@@ -1187,12 +1186,6 @@ static void l2tp_tunnel_destruct(struct sock *sk)
|
|
sk->sk_destruct = tunnel->old_sk_destruct;
|
|
sk->sk_destruct = tunnel->old_sk_destruct;
|
|
sk->sk_user_data = NULL;
|
|
sk->sk_user_data = NULL;
|
|
|
|
|
|
- /* Remove the tunnel struct from the tunnel list */
|
|
|
|
- pn = l2tp_pernet(tunnel->l2tp_net);
|
|
|
|
- spin_lock_bh(&pn->l2tp_tunnel_list_lock);
|
|
|
|
- list_del_rcu(&tunnel->list);
|
|
|
|
- spin_unlock_bh(&pn->l2tp_tunnel_list_lock);
|
|
|
|
-
|
|
|
|
/* Call the original destructor */
|
|
/* Call the original destructor */
|
|
if (sk->sk_destruct)
|
|
if (sk->sk_destruct)
|
|
(*sk->sk_destruct)(sk);
|
|
(*sk->sk_destruct)(sk);
|
|
@@ -1271,6 +1264,7 @@ static void l2tp_tunnel_del_work(struct work_struct *work)
|
|
del_work);
|
|
del_work);
|
|
struct sock *sk = tunnel->sock;
|
|
struct sock *sk = tunnel->sock;
|
|
struct socket *sock = sk->sk_socket;
|
|
struct socket *sock = sk->sk_socket;
|
|
|
|
+ struct l2tp_net *pn;
|
|
|
|
|
|
l2tp_tunnel_closeall(tunnel);
|
|
l2tp_tunnel_closeall(tunnel);
|
|
|
|
|
|
@@ -1284,6 +1278,12 @@ static void l2tp_tunnel_del_work(struct work_struct *work)
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ /* Remove the tunnel struct from the tunnel list */
|
|
|
|
+ pn = l2tp_pernet(tunnel->l2tp_net);
|
|
|
|
+ spin_lock_bh(&pn->l2tp_tunnel_list_lock);
|
|
|
|
+ list_del_rcu(&tunnel->list);
|
|
|
|
+ spin_unlock_bh(&pn->l2tp_tunnel_list_lock);
|
|
|
|
+
|
|
/* drop initial ref */
|
|
/* drop initial ref */
|
|
l2tp_tunnel_dec_refcount(tunnel);
|
|
l2tp_tunnel_dec_refcount(tunnel);
|
|
|
|
|