diff options
author | Nikolay Aleksandrov <razor@blackwall.org> | 2022-04-13 13:51:52 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2022-04-13 12:46:25 +0100 |
commit | 2e9ea3e30f696fd438319c07836422bb0bbb4608 (patch) | |
tree | 84cc9b965e5bac0557aef733992e6c371f7f26ef /net/core/rtnetlink.c | |
parent | 12dc5c2cb7b269c5a1c6d02844f40bfce942a7a6 (diff) | |
download | lwn-2e9ea3e30f696fd438319c07836422bb0bbb4608.tar.gz lwn-2e9ea3e30f696fd438319c07836422bb0bbb4608.zip |
net: rtnetlink: add helper to extract msg type's kind
Add a helper which extracts the msg type's kind using the kind mask (0x3).
Signed-off-by: Nikolay Aleksandrov <razor@blackwall.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/core/rtnetlink.c')
-rw-r--r-- | net/core/rtnetlink.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/net/core/rtnetlink.c b/net/core/rtnetlink.c index 2c36c9dc9b62..beda4a7da062 100644 --- a/net/core/rtnetlink.c +++ b/net/core/rtnetlink.c @@ -5947,7 +5947,7 @@ static int rtnetlink_rcv_msg(struct sk_buff *skb, struct nlmsghdr *nlh, return 0; family = ((struct rtgenmsg *)nlmsg_data(nlh))->rtgen_family; - kind = type&3; + kind = rtnl_msgtype_kind(type); if (kind != RTNL_KIND_GET && !netlink_net_capable(skb, CAP_NET_ADMIN)) return -EPERM; |