diff mbox series

[iproute2-next] netlink: display information from missing type extack

Message ID 20240210173244.6681-1-stephen@networkplumber.org (mailing list archive)
State Accepted
Commit 7e646c80d7573bc4791b268a8dee472f11c33ff1
Delegated to: David Ahern
Headers show
Series [iproute2-next] netlink: display information from missing type extack | expand

Checks

Context Check Description
netdev/tree_selection success Not a local patch

Commit Message

Stephen Hemminger Feb. 10, 2024, 5:32 p.m. UTC
The kernel will now send missing type information in error response.
Print it if present.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 lib/libnetlink.c | 4 ++++
 1 file changed, 4 insertions(+)

Comments

patchwork-bot+netdevbpf@kernel.org Feb. 18, 2024, 5:50 p.m. UTC | #1
Hello:

This patch was applied to iproute2/iproute2-next.git (main)
by David Ahern <dsahern@kernel.org>:

On Sat, 10 Feb 2024 09:32:31 -0800 you wrote:
> The kernel will now send missing type information in error response.
> Print it if present.
> 
> Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
> ---
>  lib/libnetlink.c | 4 ++++
>  1 file changed, 4 insertions(+)

Here is the summary with links:
  - [iproute2-next] netlink: display information from missing type extack
    https://git.kernel.org/pub/scm/network/iproute2/iproute2-next.git/commit/?id=7e646c80d757

You are awesome, thank you!
diff mbox series

Patch

diff --git a/lib/libnetlink.c b/lib/libnetlink.c
index 016482294276..e2b284e6998c 100644
--- a/lib/libnetlink.c
+++ b/lib/libnetlink.c
@@ -111,6 +111,10 @@  int nl_dump_ext_ack(const struct nlmsghdr *nlh, nl_ext_ack_fn_t errfn)
 			err_nlh = &err->msg;
 	}
 
+	if (tb[NLMSGERR_ATTR_MISS_TYPE])
+		fprintf(stderr, "Missing required attribute type %u\n",
+			mnl_attr_get_u32(tb[NLMSGERR_ATTR_MISS_TYPE]));
+
 	if (errfn)
 		return errfn(msg, off, err_nlh);