summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorEric W. Biederman <ebiederm@xmission.com>2014-04-23 14:26:56 -0700
committerJiri Slaby <jslaby@suse.cz>2014-06-23 10:27:56 +0200
commit8c91777bd4951c1f1ad59842fe4d208f94a97dfe (patch)
tree1efd2d09f6d7b3b76c3458c4af1a9c5dfd66d652 /include
parent4dcecf4ce16a20c210e91a62ae28275418e3ed2c (diff)
net: Add variants of capable for use on on sockets
[ Upstream commit a3b299da869d6e78cf42ae0b1b41797bcb8c5e4b ] sk_net_capable - The common case, operations that are safe in a network namespace. sk_capable - Operations that are not known to be safe in a network namespace sk_ns_capable - The general case for special cases. Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Diffstat (limited to 'include')
-rw-r--r--include/net/sock.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/include/net/sock.h b/include/net/sock.h
index 6e2c4901a477..4aa873a6267f 100644
--- a/include/net/sock.h
+++ b/include/net/sock.h
@@ -2275,6 +2275,11 @@ extern int sock_get_timestampns(struct sock *, struct timespec __user *);
extern int sock_recv_errqueue(struct sock *sk, struct msghdr *msg, int len,
int level, int type);
+bool sk_ns_capable(const struct sock *sk,
+ struct user_namespace *user_ns, int cap);
+bool sk_capable(const struct sock *sk, int cap);
+bool sk_net_capable(const struct sock *sk, int cap);
+
/*
* Enable debug/info messages
*/