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>
This commit is contained in:
Stephen Hemminger 2024-02-10 09:32:31 -08:00 committed by David Ahern
parent f900302f32
commit 7e646c80d7

View File

@ -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);