summaryrefslogtreecommitdiff
path: root/net/ieee802154/socket.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/ieee802154/socket.c')
-rw-r--r--net/ieee802154/socket.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/net/ieee802154/socket.c b/net/ieee802154/socket.c
index bf5d26d83af0..f66e4afb978a 100644
--- a/net/ieee802154/socket.c
+++ b/net/ieee802154/socket.c
@@ -1003,6 +1003,9 @@ static int ieee802154_create(struct net *net, struct socket *sock,
switch (sock->type) {
case SOCK_RAW:
+ rc = -EPERM;
+ if (!capable(CAP_NET_RAW))
+ goto out;
proto = &ieee802154_raw_prot;
ops = &ieee802154_raw_ops;
break;