l2tp: hold tunnel socket when handling control frames in l2tp_ip and l2tp_ip6
[pandora-kernel.git] / net / l2tp / l2tp_ip.c
index 8173ee3..3be93d1 100644 (file)
@@ -190,9 +190,10 @@ pass_up:
 
        tunnel_id = ntohl(*(__be32 *) &skb->data[4]);
        tunnel = l2tp_tunnel_find(&init_net, tunnel_id);
-       if (tunnel != NULL)
+       if (tunnel) {
                sk = tunnel->sock;
-       else {
+               sock_hold(sk);
+       } else {
                struct iphdr *iph = (struct iphdr *) skb_network_header(skb);
 
                read_lock_bh(&l2tp_ip_lock);