aboutsummaryrefslogtreecommitdiffstats
path: root/net/netlink/af_netlink.c
diff options
context:
space:
mode:
authorJakub Kicinski <jakub.kicinski@netronome.com>2019-01-18 10:46:13 -0800
committerDavid S. Miller <davem@davemloft.net>2019-01-19 10:09:58 -0800
commit59c28058fa7bb1cc7ab8b2c5607093cbbefafeb4 (patch)
tree18e5719ebf19cdd5432ead16a2425f60719fa1fe /net/netlink/af_netlink.c
parentvirtio-net: per-queue RPS config (diff)
downloadlinux-dev-59c28058fa7bb1cc7ab8b2c5607093cbbefafeb4.tar.xz
linux-dev-59c28058fa7bb1cc7ab8b2c5607093cbbefafeb4.zip
net: netlink: add helper to retrieve NETLINK_F_STRICT_CHK
Dumps can read state of the NETLINK_F_STRICT_CHK flag from a field in the callback structure. For non-dump GET requests we need a way to access the state of that flag from a socket. Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/netlink/af_netlink.c')
-rw-r--r--net/netlink/af_netlink.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/net/netlink/af_netlink.c b/net/netlink/af_netlink.c
index 3c023d6120f6..8fa35df94c07 100644
--- a/net/netlink/af_netlink.c
+++ b/net/netlink/af_netlink.c
@@ -1371,6 +1371,14 @@ int netlink_has_listeners(struct sock *sk, unsigned int group)
}
EXPORT_SYMBOL_GPL(netlink_has_listeners);
+bool netlink_strict_get_check(struct sk_buff *skb)
+{
+ const struct netlink_sock *nlk = nlk_sk(NETLINK_CB(skb).sk);
+
+ return nlk->flags & NETLINK_F_STRICT_CHK;
+}
+EXPORT_SYMBOL_GPL(netlink_strict_get_check);
+
static int netlink_broadcast_deliver(struct sock *sk, struct sk_buff *skb)
{
struct netlink_sock *nlk = nlk_sk(sk);