]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
nl80211: Debug print error from airtime weight configuration
authorJouni Malinen <j@w1.fi>
Fri, 19 Mar 2021 22:15:53 +0000 (00:15 +0200)
committerJouni Malinen <j@w1.fi>
Fri, 19 Mar 2021 22:15:53 +0000 (00:15 +0200)
It is better to be able to determine whether the airtime weight
configuration for a STA actually was accepted by the driver or not.

Signed-off-by: Jouni Malinen <j@w1.fi>
src/drivers/driver_nl80211.c

index 35526fc2fe0618ade14c1951332c9a57fd75003d..e7a28cae2aff2b3183a3c8eec9ce7a546e33e9b6 100644 (file)
@@ -5789,6 +5789,7 @@ static int driver_nl80211_sta_set_airtime_weight(void *priv, const u8 *addr,
 {
        struct i802_bss *bss = priv;
        struct nl_msg *msg;
+       int ret;
 
        wpa_printf(MSG_DEBUG,
                   "nl80211: Set STA airtime weight - ifname=%s addr=" MACSTR
@@ -5799,7 +5800,13 @@ static int driver_nl80211_sta_set_airtime_weight(void *priv, const u8 *addr,
            nla_put_u16(msg, NL80211_ATTR_AIRTIME_WEIGHT, weight))
                goto fail;
 
-       return send_and_recv_msgs(bss->drv, msg, NULL, NULL, NULL, NULL);
+       ret = send_and_recv_msgs(bss->drv, msg, NULL, NULL, NULL, NULL);
+       if (ret) {
+               wpa_printf(MSG_DEBUG,
+                          "nl80211: SET_STATION[AIRTIME_WEIGHT] failed: ret=%d (%s)",
+                          ret, strerror(-ret));
+       }
+       return ret;
 fail:
        nlmsg_free(msg);
        return -ENOBUFS;