From 531599ccd0729e0baf9b8243d2483ee9253f838a Mon Sep 17 00:00:00 2001 From: Hauke Mehrtens Date: Sat, 26 Jan 2019 17:15:53 +0100 Subject: backports: Add nl_set_extack_cookie_u64() This was introduced in Linux commit 801f87469ee8 ("netlink: add nl_set_extack_cookie_u64()") and is used by the wireless subsystem. Signed-off-by: Hauke Mehrtens --- backport/backport-include/linux/netlink.h | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/backport/backport-include/linux/netlink.h b/backport/backport-include/linux/netlink.h index f956a769..0fb8e0f3 100644 --- a/backport/backport-include/linux/netlink.h +++ b/backport/backport-include/linux/netlink.h @@ -58,4 +58,15 @@ struct netlink_ext_ack { } while (0) #endif /* NL_SET_BAD_ATTR */ +#if LINUX_VERSION_IS_LESS(5,0,0) +static inline void nl_set_extack_cookie_u64(struct netlink_ext_ack *extack, + u64 cookie) +{ + u64 __cookie = cookie; + + memcpy(extack->cookie, &__cookie, sizeof(__cookie)); + extack->cookie_len = sizeof(__cookie); +} +#endif + #endif /* __BACKPORT_LINUX_NETLINK_H */ -- cgit v1.2.3