diff options
| author | Jakub Kicinski <[email protected]> | 2023-01-04 20:05:21 -0800 |
|---|---|---|
| committer | Jakub Kicinski <[email protected]> | 2023-01-05 22:13:39 -0800 |
| commit | 2c7bc10d0f7b0f66d9042ed88bb3ecd588352a00 (patch) | |
| tree | 19b1b26c184a35febcfbdbbd1b1a6c44e62abd82 /include/linux | |
| parent | 623cd13b165486afaa2df706d49209392f3764ca (diff) | |
netlink: add macro for checking dump ctx size
We encourage casting struct netlink_callback::ctx to a local
struct (in a comment above the field). Provide a convenience
macro for checking if the local struct fits into the ctx.
Reviewed-by: Jacob Keller <[email protected]>
Reviewed-by: Jiri Pirko <[email protected]>
Signed-off-by: Jakub Kicinski <[email protected]>
Diffstat (limited to 'include/linux')
| -rw-r--r-- | include/linux/netlink.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/include/linux/netlink.h b/include/linux/netlink.h index d81bde5a5844..38f6334f408c 100644 --- a/include/linux/netlink.h +++ b/include/linux/netlink.h @@ -263,6 +263,10 @@ struct netlink_callback { }; }; +#define NL_ASSET_DUMP_CTX_FITS(type_name) \ + BUILD_BUG_ON(sizeof(type_name) > \ + sizeof_field(struct netlink_callback, ctx)) + struct netlink_notify { struct net *net; u32 portid; |