diff options
| author | David S. Miller <[email protected]> | 2019-01-19 10:09:59 -0800 |
|---|---|---|
| committer | David S. Miller <[email protected]> | 2019-01-19 10:09:59 -0800 |
| commit | e266afa9c7afc51deaaf1e1566a8dfbc6f632b07 (patch) | |
| tree | 706b013a6ff1715d81bd3054721a8ecdaf9aa16d /net/netlink/af_netlink.c | |
| parent | 133bbb18ab1a2f5549435c5a3126413344ddbcb8 (diff) | |
| parent | 0c4056ee8433487cfcc19621b85586c88ec927c0 (diff) | |
Merge branch 'net-use-strict-checks-in-doit-handlers'
Jakub Kicinski says:
====================
net: use strict checks in doit handlers
This series extends strict argument checking to doit handlers
of the GET* nature. This is a bit tricky since strict checking
flag has already been released..
iproute2 did not have a release with strick checks enabled,
and it will only need a minor one-liner to pass strick checks
after all the work that DaveA has already done.
Big thanks to Dave Ahern for help and guidence.
v2:
- remove unnecessary check in patch 5 (Nicolas);
- add path 7 (DaveA);
- improve messages in patch 8 (DaveA).
====================
Signed-off-by: David S. Miller <[email protected]>
Diffstat (limited to 'net/netlink/af_netlink.c')
| -rw-r--r-- | net/netlink/af_netlink.c | 8 |
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); |