Skip to content

Commit f1388ec

Browse files
mkubecekdavem330
authored andcommitted
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]>
1 parent fe2a31d commit f1388ec

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

include/linux/netlink.h

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,15 @@ static inline void nl_set_extack_cookie_u64(struct netlink_ext_ack *extack,
119119
extack->cookie_len = sizeof(__cookie);
120120
}
121121

122+
static inline void nl_set_extack_cookie_u32(struct netlink_ext_ack *extack,
123+
u32 cookie)
124+
{
125+
u32 __cookie = cookie;
126+
127+
memcpy(extack->cookie, &__cookie, sizeof(__cookie));
128+
extack->cookie_len = sizeof(__cookie);
129+
}
130+
122131
void netlink_kernel_release(struct sock *sk);
123132
int __netlink_change_ngroups(struct sock *sk, unsigned int groups);
124133
int netlink_change_ngroups(struct sock *sk, unsigned int groups);

0 commit comments

Comments
 (0)