diff options
author | Eric W. Biederman <ebiederm@xmission.com> | 2014-04-23 14:26:56 -0700 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2014-06-26 15:12:37 -0400 |
commit | c35b4e287f5ede32bae6db1aef1ae3e9174bb2ff (patch) | |
tree | 2b2e7e787a1c49166df41c0ecc2d20a3aa585730 /include | |
parent | f0efa2954c20ab833bf99acba0a0817f1deee9e0 (diff) | |
download | linux-3.10-c35b4e287f5ede32bae6db1aef1ae3e9174bb2ff.tar.gz linux-3.10-c35b4e287f5ede32bae6db1aef1ae3e9174bb2ff.tar.bz2 linux-3.10-c35b4e287f5ede32bae6db1aef1ae3e9174bb2ff.zip |
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: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'include')
-rw-r--r-- | include/net/sock.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/include/net/sock.h b/include/net/sock.h index 8f32b779bc8..72f710d2f75 100644 --- a/include/net/sock.h +++ b/include/net/sock.h @@ -2248,6 +2248,11 @@ extern void sock_enable_timestamp(struct sock *sk, int flag); extern int sock_get_timestamp(struct sock *, struct timeval __user *); extern int sock_get_timestampns(struct sock *, struct timespec __user *); +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 */ |