From: Stephen Hemminger Date: Sat, 10 Feb 2024 17:32:31 +0000 (-0800) Subject: netlink: display information from missing type extack X-Git-Tag: v6.9.0~32^2~11 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7e646c80d7573bc4791b268a8dee472f11c33ff1;p=thirdparty%2Fiproute2.git 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 Signed-off-by: David Ahern --- diff --git a/lib/libnetlink.c b/lib/libnetlink.c index 01648229..e2b284e6 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);