diff options
author | Eric W. Biederman <ebiederm@xmission.com> | 2015-05-08 22:09:13 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2015-05-11 10:50:17 -0400 |
commit | 11aa9c28b4209242a9de0a661a7b3405adb568a0 (patch) | |
tree | d0dda021d89c17c54d54d227269f937d2d73b542 /net/llc | |
parent | eeb1bd5c40edb0e2fd925c8535e2fdebdbc5cef2 (diff) |
net: Pass kern from net_proto_family.create to sk_alloc
In preparation for changing how struct net is refcounted
on kernel sockets pass the knowledge that we are creating
a kernel socket from sock_create_kern through to sk_alloc.
Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/llc')
-rw-r--r-- | net/llc/af_llc.c | 2 | ||||
-rw-r--r-- | net/llc/llc_conn.c | 6 |
2 files changed, 4 insertions, 4 deletions
diff --git a/net/llc/af_llc.c b/net/llc/af_llc.c index 17a8dff06090..8fd9febaa5ba 100644 --- a/net/llc/af_llc.c +++ b/net/llc/af_llc.c | |||
@@ -168,7 +168,7 @@ static int llc_ui_create(struct net *net, struct socket *sock, int protocol, | |||
168 | 168 | ||
169 | if (likely(sock->type == SOCK_DGRAM || sock->type == SOCK_STREAM)) { | 169 | if (likely(sock->type == SOCK_DGRAM || sock->type == SOCK_STREAM)) { |
170 | rc = -ENOMEM; | 170 | rc = -ENOMEM; |
171 | sk = llc_sk_alloc(net, PF_LLC, GFP_KERNEL, &llc_proto); | 171 | sk = llc_sk_alloc(net, PF_LLC, GFP_KERNEL, &llc_proto, kern); |
172 | if (sk) { | 172 | if (sk) { |
173 | rc = 0; | 173 | rc = 0; |
174 | llc_ui_sk_init(sock, sk); | 174 | llc_ui_sk_init(sock, sk); |
diff --git a/net/llc/llc_conn.c b/net/llc/llc_conn.c index 81a61fce3afb..3e821daf9dd4 100644 --- a/net/llc/llc_conn.c +++ b/net/llc/llc_conn.c | |||
@@ -768,7 +768,7 @@ static struct sock *llc_create_incoming_sock(struct sock *sk, | |||
768 | struct llc_addr *daddr) | 768 | struct llc_addr *daddr) |
769 | { | 769 | { |
770 | struct sock *newsk = llc_sk_alloc(sock_net(sk), sk->sk_family, GFP_ATOMIC, | 770 | struct sock *newsk = llc_sk_alloc(sock_net(sk), sk->sk_family, GFP_ATOMIC, |
771 | sk->sk_prot); | 771 | sk->sk_prot, 0); |
772 | struct llc_sock *newllc, *llc = llc_sk(sk); | 772 | struct llc_sock *newllc, *llc = llc_sk(sk); |
773 | 773 | ||
774 | if (!newsk) | 774 | if (!newsk) |
@@ -931,9 +931,9 @@ static void llc_sk_init(struct sock *sk) | |||
931 | * Allocates a LLC sock and initializes it. Returns the new LLC sock | 931 | * Allocates a LLC sock and initializes it. Returns the new LLC sock |
932 | * or %NULL if there's no memory available for one | 932 | * or %NULL if there's no memory available for one |
933 | */ | 933 | */ |
934 | struct sock *llc_sk_alloc(struct net *net, int family, gfp_t priority, struct proto *prot) | 934 | struct sock *llc_sk_alloc(struct net *net, int family, gfp_t priority, struct proto *prot, int kern) |
935 | { | 935 | { |
936 | struct sock *sk = sk_alloc(net, family, priority, prot); | 936 | struct sock *sk = sk_alloc(net, family, priority, prot, kern); |
937 | 937 | ||
938 | if (!sk) | 938 | if (!sk) |
939 | goto out; | 939 | goto out; |