aboutsummaryrefslogtreecommitdiffstats
path: root/net/llc/af_llc.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/llc/af_llc.c')
-rw-r--r--net/llc/af_llc.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/net/llc/af_llc.c b/net/llc/af_llc.c
index 7aa4fd170104..3a66546cad06 100644
--- a/net/llc/af_llc.c
+++ b/net/llc/af_llc.c
@@ -140,14 +140,17 @@ static struct proto llc_proto = {
140 140
141/** 141/**
142 * llc_ui_create - alloc and init a new llc_ui socket 142 * llc_ui_create - alloc and init a new llc_ui socket
143 * @net: network namespace (must be default network)
143 * @sock: Socket to initialize and attach allocated sk to. 144 * @sock: Socket to initialize and attach allocated sk to.
144 * @protocol: Unused. 145 * @protocol: Unused.
146 * @kern: on behalf of kernel or userspace
145 * 147 *
146 * Allocate and initialize a new llc_ui socket, validate the user wants a 148 * Allocate and initialize a new llc_ui socket, validate the user wants a
147 * socket type we have available. 149 * socket type we have available.
148 * Returns 0 upon success, negative upon failure. 150 * Returns 0 upon success, negative upon failure.
149 */ 151 */
150static int llc_ui_create(struct net *net, struct socket *sock, int protocol) 152static int llc_ui_create(struct net *net, struct socket *sock, int protocol,
153 int kern)
151{ 154{
152 struct sock *sk; 155 struct sock *sk;
153 int rc = -ESOCKTNOSUPPORT; 156 int rc = -ESOCKTNOSUPPORT;
@@ -155,7 +158,7 @@ static int llc_ui_create(struct net *net, struct socket *sock, int protocol)
155 if (!capable(CAP_NET_RAW)) 158 if (!capable(CAP_NET_RAW))
156 return -EPERM; 159 return -EPERM;
157 160
158 if (net != &init_net) 161 if (!net_eq(net, &init_net))
159 return -EAFNOSUPPORT; 162 return -EAFNOSUPPORT;
160 163
161 if (likely(sock->type == SOCK_DGRAM || sock->type == SOCK_STREAM)) { 164 if (likely(sock->type == SOCK_DGRAM || sock->type == SOCK_STREAM)) {
@@ -1092,7 +1095,7 @@ out:
1092 return rc; 1095 return rc;
1093} 1096}
1094 1097
1095static struct net_proto_family llc_ui_family_ops = { 1098static const struct net_proto_family llc_ui_family_ops = {
1096 .family = PF_LLC, 1099 .family = PF_LLC,
1097 .create = llc_ui_create, 1100 .create = llc_ui_create,
1098 .owner = THIS_MODULE, 1101 .owner = THIS_MODULE,