diff options
author | Stephen Hemminger <stephen@networkplumber.org> | 2024-02-10 09:32:31 -0800 |
---|---|---|
committer | David Ahern <dsahern@kernel.org> | 2024-02-18 17:41:56 +0000 |
commit | 7e646c80d7573bc4791b268a8dee472f11c33ff1 (patch) | |
tree | af526955357371cd122696c9bbc1a12ec01c56fe | |
parent | f900302f3295fdde36f508ebfb9a2a68f115fe09 (diff) | |
download | iproute2-7e646c80d7573bc4791b268a8dee472f11c33ff1.tar.gz |
netlink: display information from missing type extack
The kernel will now send missing type information in error response.
Print it if present.
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Signed-off-by: David Ahern <dsahern@kernel.org>
-rw-r--r-- | lib/libnetlink.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/libnetlink.c b/lib/libnetlink.c index 016482294..e2b284e69 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); |