]> git.ipfire.org Git - thirdparty/iproute2.git/commitdiff
netlink: display information from missing type extack
authorStephen Hemminger <stephen@networkplumber.org>
Sat, 10 Feb 2024 17:32:31 +0000 (09:32 -0800)
committerDavid Ahern <dsahern@kernel.org>
Sun, 18 Feb 2024 17:41:56 +0000 (17:41 +0000)
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>
lib/libnetlink.c

index 016482294276c334ff2392e0c80d8eff819533c3..e2b284e6998c89430141aa30d286a8c5e87c99cd 100644 (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);