X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=net%2Fllc%2Faf_llc.c;h=5bcc452a247fb54338dc1fac77563df7d6c49f4a;hb=5554b35933245e95710d709175e14c02cbc956a4;hp=f93b576185823321ce38897ce450a7990f263fbb;hpb=76fef2b6bffa13ad7ccd54c0493b053295721b9a;p=linux-2.6 diff --git a/net/llc/af_llc.c b/net/llc/af_llc.c index f93b576185..5bcc452a24 100644 --- a/net/llc/af_llc.c +++ b/net/llc/af_llc.c @@ -128,10 +128,8 @@ static int llc_ui_send_data(struct sock* sk, struct sk_buff *skb, int noblock) static void llc_ui_sk_init(struct socket *sock, struct sock *sk) { + sock_graft(sk, sock); sk->sk_type = sock->type; - sk->sk_sleep = &sock->wait; - sk->sk_socket = sock; - sock->sk = sk; sock->ops = &llc_ui_ops; } @@ -155,6 +153,9 @@ static int llc_ui_create(struct net *net, struct socket *sock, int protocol) struct sock *sk; int rc = -ESOCKTNOSUPPORT; + if (!capable(CAP_NET_RAW)) + return -EPERM; + if (net != &init_net) return -EAFNOSUPPORT;