nl80211: Fix send commands to return 0 on success
driver.h defines these functions to return 0 on success, not number of bytes transmitted. Most callers are checking "< 0" for error condition, but not all. Address this by following the driver API specification on 0 meaning success.
This commit is contained in:
parent
1d39378a0b
commit
ebbec8b2fa
1 changed files with 7 additions and 1 deletions
|
@ -3305,11 +3305,17 @@ static int wpa_driver_nl80211_send_frame(struct wpa_driver_nl80211_data *drv,
|
||||||
.msg_controllen = 0,
|
.msg_controllen = 0,
|
||||||
.msg_flags = 0,
|
.msg_flags = 0,
|
||||||
};
|
};
|
||||||
|
int res;
|
||||||
|
|
||||||
if (encrypt)
|
if (encrypt)
|
||||||
rtap_hdr[8] |= IEEE80211_RADIOTAP_F_WEP;
|
rtap_hdr[8] |= IEEE80211_RADIOTAP_F_WEP;
|
||||||
|
|
||||||
return sendmsg(drv->monitor_sock, &msg, 0);
|
res = sendmsg(drv->monitor_sock, &msg, 0);
|
||||||
|
if (res < 0) {
|
||||||
|
wpa_printf(MSG_INFO, "nl80211: sendmsg: %s", strerror(errno));
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue