diff options
| author | Michal Kubecek <[email protected]> | 2020-03-15 17:17:48 +0000 |
|---|---|---|
| committer | David S. Miller <[email protected]> | 2020-03-16 09:04:24 +0000 |
| commit | f1388ec4a144f40348321a0915c5535d623e165c (patch) | |
| tree | 6c5454f8c704a2ddcf4b69f5a15cb1ed537d6482 | |
| parent | netlink: allow extack cookie also for error messages (diff) | |
| download | kernel-f1388ec4a144f40348321a0915c5535d623e165c.tar.gz kernel-f1388ec4a144f40348321a0915c5535d623e165c.zip | |
netlink: add nl_set_extack_cookie_u32()
Similar to existing nl_set_extack_cookie_u64(), add new helper
nl_set_extack_cookie_u32() which sets extack cookie to a u32 value.
Signed-off-by: Michal Kubecek <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
| -rw-r--r-- | include/linux/netlink.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/include/linux/netlink.h b/include/linux/netlink.h index 205fa7b1f07a..4090524c3462 100644 --- a/include/linux/netlink.h +++ b/include/linux/netlink.h @@ -119,6 +119,15 @@ static inline void nl_set_extack_cookie_u64(struct netlink_ext_ack *extack, extack->cookie_len = sizeof(__cookie); } +static inline void nl_set_extack_cookie_u32(struct netlink_ext_ack *extack, + u32 cookie) +{ + u32 __cookie = cookie; + + memcpy(extack->cookie, &__cookie, sizeof(__cookie)); + extack->cookie_len = sizeof(__cookie); +} + void netlink_kernel_release(struct sock *sk); int __netlink_change_ngroups(struct sock *sk, unsigned int groups); int netlink_change_ngroups(struct sock *sk, unsigned int groups); |
