From: Benjamin Berg <benjamin.berg@xxxxxxxxx> This information is easy to provide and it can be useful if the kernel rejects an operation. Signed-off-by: Benjamin Berg <benjamin.berg@xxxxxxxxx> --- src/drivers/driver_nl80211.c | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/src/drivers/driver_nl80211.c b/src/drivers/driver_nl80211.c index 0cc5b4b0e1..c330140065 100644 --- a/src/drivers/driver_nl80211.c +++ b/src/drivers/driver_nl80211.c @@ -391,17 +391,26 @@ static int error_handler(struct sockaddr_nl *nla, struct nlmsgerr *err, len, (char *) nla_data(tb[NLMSGERR_ATTR_MSG])); } - if (!err_args->err_info) - return NL_SKIP; - - /* Check if it was a per-link error report */ - + /* Done if the the problematic attribute was not specified */ if (!tb[NLMSGERR_ATTR_OFFS] || os_memcmp(orig_nlh, &err->msg, sizeof(err->msg)) != 0) return NL_SKIP; offset = nla_get_u32(tb[NLMSGERR_ATTR_OFFS]); + if (offset < orig_nlh->nlmsg_len) { + struct nlattr *orig_attr = + (void *) ((unsigned char *) orig_nlh + offset); + + wpa_printf(MSG_DEBUG, + "nl80211: kernel reports error at offset %u, attribute type %d", + offset, nla_type(orig_attr)); + } + + /* Resolve problematic link if err_info is not NULL */ + if (!err_args->err_info) + return NL_SKIP; + mlo_links = nlmsg_find_attr(orig_nlh, GENL_HDRLEN, NL80211_ATTR_MLO_LINKS); if (!mlo_links) -- 2.50.0 _______________________________________________ Hostap mailing list Hostap@xxxxxxxxxxxxxxxxxxx http://lists.infradead.org/mailman/listinfo/hostap