From: Jouni Malinen Date: Thu, 15 Apr 2010 20:46:49 +0000 (+0300) Subject: nl80211: Add more debug info on NL80211_ATTR_STA_VLAN failures X-Git-Tag: hostap_0_7_2~23 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=cd1d72c1d0d67f6230de96cfacb435d091701a20;p=thirdparty%2Fhostap.git nl80211: Add more debug info on NL80211_ATTR_STA_VLAN failures --- diff --git a/src/drivers/driver_nl80211.c b/src/drivers/driver_nl80211.c index 6ea2999c7..877cde08c 100644 --- a/src/drivers/driver_nl80211.c +++ b/src/drivers/driver_nl80211.c @@ -4503,6 +4503,7 @@ static int i802_set_sta_vlan(void *priv, const u8 *addr, struct i802_bss *bss = priv; struct wpa_driver_nl80211_data *drv = bss->drv; struct nl_msg *msg; + int ret = -ENOBUFS; msg = nlmsg_alloc(); if (!msg) @@ -4517,9 +4518,15 @@ static int i802_set_sta_vlan(void *priv, const u8 *addr, NLA_PUT_U32(msg, NL80211_ATTR_STA_VLAN, if_nametoindex(ifname)); - return send_and_recv_msgs(drv, msg, NULL, NULL); + ret = send_and_recv_msgs(drv, msg, NULL, NULL); + if (ret < 0) { + wpa_printf(MSG_ERROR, "nl80211: NL80211_ATTR_STA_VLAN (addr=" + MACSTR " ifname=%s vlan_id=%d) failed: %d (%s)", + MAC2STR(addr), ifname, vlan_id, ret, + strerror(-ret)); + } nla_put_failure: - return -ENOBUFS; + return ret; }