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.
.msg_controllen = 0,
.msg_flags = 0,
};
+ int res;
if (encrypt)
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;
}