Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 361795
b: refs/heads/master
c: 02d13ed
h: refs/heads/master
i:
  361793: e38eaad
  361791: 4441a32
v: v3
  • Loading branch information
Tom Parkin authored and David S. Miller committed Mar 20, 2013
1 parent 78ec4f5 commit 7a75cb3
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 9 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 8abbbe8ff572fd84d1b98eb9acf30611a97cf72e
refs/heads/master: 02d13ed5f94af38c37d1abd53462fe48d78bcc9d
18 changes: 10 additions & 8 deletions trunk/net/l2tp/l2tp_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -1412,19 +1412,21 @@ static void l2tp_tunnel_del_work(struct work_struct *work)
return;

sock = sk->sk_socket;
BUG_ON(!sock);

/* If the tunnel socket was created directly by the kernel, use the
* sk_* API to release the socket now. Otherwise go through the
* inet_* layer to shut the socket down, and let userspace close it.
/* If the tunnel socket was created by userspace, then go through the
* inet layer to shut the socket down, and let userspace close it.
* Otherwise, if we created the socket directly within the kernel, use
* the sk API to release it here.
* In either case the tunnel resources are freed in the socket
* destructor when the tunnel socket goes away.
*/
if (sock->file == NULL) {
kernel_sock_shutdown(sock, SHUT_RDWR);
sk_release_kernel(sk);
if (tunnel->fd >= 0) {
if (sock)
inet_shutdown(sock, 2);
} else {
inet_shutdown(sock, 2);
if (sock)
kernel_sock_shutdown(sock, SHUT_RDWR);
sk_release_kernel(sk);
}

l2tp_tunnel_sock_put(sk);
Expand Down

0 comments on commit 7a75cb3

Please sign in to comment.