Displaying 2 results from an estimated 2 matches for "nl_set_err_msg_fmt".
2023 Jan 29
3
[Bridge] [PATCH net-next v2] netlink: provide an ability to set default extack message
...leonro at nvidia.com>
---
Changelog:
v2:
* Removed () brackets around msg to fix compilation error.
v1: https://lore.kernel.org/all/d4843760219f20367c27472f084bd8aa729cf321.1674995155.git.leon at kernel.org
* Added special *_WEAK() macro instead of embedding same check in
NL_SET_ERR_MSG_MOD/NL_SET_ERR_MSG_FMT.
* Reuse same macro for XFRM code which triggered this patch.
v0: https://lore.kernel.org/all/2919eb55e2e9b92265a3ba600afc8137a901ae5f.1674760340.git.leon at kernel.org
---
include/linux/netlink.h | 10 ++++++++++
net/bridge/br_switchdev.c | 10 ++++------
net/dsa/master.c | 4 +---
n...
2023 Jan 26
1
[Bridge] [PATCH net-next] netlink: provide an ability to set default extack message
...nclude/linux/netlink.h
@@ -101,7 +101,7 @@ struct netlink_ext_ack {
\
do_trace_netlink_extack(__msg); \
\
- if (__extack) \
+ if (__extack && !__extack->_msg) \
__extack->_msg = __msg; \
} while (0)
@@ -111,7 +111,7 @@ struct netlink_ext_ack {
#define NL_SET_ERR_MSG_FMT(extack, fmt, args...) do { \
struct netlink_ext_ack *__extack = (extack); \
\
- if (!__extack) \
+ if (!__extack || __extack->_msg) \
break; \
if (snprintf(__extack->_msg_buf, NETLINK_MAX_FMTMSG_LEN, \...