Skip to content

Commit 2b551c6

Browse files
tomparkindavem330
authored andcommitted
l2tp: close sessions before initiating tunnel delete
When a user deletes a tunnel using netlink, all the sessions in the tunnel should also be deleted. Since running sessions will pin the tunnel socket with the references they hold, have the l2tp_tunnel_delete close all sessions in a tunnel before finally closing the tunnel socket. 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>
1 parent 9360631 commit 2b551c6

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

net/l2tp/l2tp_core.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1737,6 +1737,7 @@ EXPORT_SYMBOL_GPL(l2tp_tunnel_create);
17371737
*/
17381738
int l2tp_tunnel_delete(struct l2tp_tunnel *tunnel)
17391739
{
1740+
l2tp_tunnel_closeall(tunnel);
17401741
return (false == queue_work(l2tp_wq, &tunnel->del_work));
17411742
}
17421743
EXPORT_SYMBOL_GPL(l2tp_tunnel_delete);

0 commit comments

Comments
 (0)