commit f3d16781e73cbe909ad84d12e3e21a81484c5d64
parent 1f2c588d9d5f662b35ae65b0edd47c92881dba84
Author: oblique <psyberbits@gmail.com>
Date: Thu, 1 Mar 2012 14:50:18 +0200
fix a bug in read_bssid
Diffstat:
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/wificurse.c b/wificurse.c
@@ -233,7 +233,9 @@ int read_bssid(int fd, uint8_t *bssid) {
struct mgmt_frame *beacon;
r = iw_read(fd, buf, sizeof(buf), &pkt, &pkt_sz);
- if (r < 0)
+ if (r == -EAGAIN)
+ return -EAGAIN;
+ else if (r < 0)
return GOTERR;
beacon = (struct mgmt_frame*)pkt;
@@ -330,7 +332,7 @@ int main(int argc, char *argv[]) {
ret = read_bssid(dev.fd, bssid);
if (ret == -EAGAIN)
continue;
- if (ret < 0) { // error
+ else if (ret < 0) { // error
print_error();
goto _errout;
} else { // got BSSID