aboutsummaryrefslogtreecommitdiffstats
path: root/hostapd
diff options
context:
space:
mode:
authorJouni Malinen <j@w1.fi>2014-10-11 16:29:22 (GMT)
committerJouni Malinen <j@w1.fi>2014-10-11 16:43:26 (GMT)
commit8e3e0b3f573a69ff5b916ee75b369680840734cd (patch)
treedfbf84d77a36ae37b254976c60d0cfdbd25b3a60 /hostapd
parent08ef4426a796b5a5f66f1ade233664a812910d1f (diff)
downloadhostap-8e3e0b3f573a69ff5b916ee75b369680840734cd.zip
hostap-8e3e0b3f573a69ff5b916ee75b369680840734cd.tar.gz
hostap-8e3e0b3f573a69ff5b916ee75b369680840734cd.tar.bz2
Report sendto() failures for hostapd ctrl_iface
This makes issues with control interface operations more easily debuggable (CID 72681, CID 72686). Signed-off-by: Jouni Malinen <j@w1.fi>
Diffstat (limited to 'hostapd')
-rw-r--r--hostapd/ctrl_iface.c19
1 files changed, 15 insertions, 4 deletions
diff --git a/hostapd/ctrl_iface.c b/hostapd/ctrl_iface.c
index ec456c8..e87de9f 100644
--- a/hostapd/ctrl_iface.c
+++ b/hostapd/ctrl_iface.c
@@ -1416,8 +1416,11 @@ static void hostapd_ctrl_iface_receive(int sock, void *eloop_ctx,
reply = os_malloc(reply_size);
if (reply == NULL) {
- sendto(sock, "FAIL\n", 5, 0, (struct sockaddr *) &from,
- fromlen);
+ if (sendto(sock, "FAIL\n", 5, 0, (struct sockaddr *) &from,
+ fromlen) < 0) {
+ wpa_printf(MSG_DEBUG, "CTRL: sendto failed: %s",
+ strerror(errno));
+ }
return;
}
@@ -1611,7 +1614,11 @@ static void hostapd_ctrl_iface_receive(int sock, void *eloop_ctx,
os_memcpy(reply, "FAIL\n", 5);
reply_len = 5;
}
- sendto(sock, reply, reply_len, 0, (struct sockaddr *) &from, fromlen);
+ if (sendto(sock, reply, reply_len, 0, (struct sockaddr *) &from,
+ fromlen) < 0) {
+ wpa_printf(MSG_DEBUG, "CTRL: sendto failed: %s",
+ strerror(errno));
+ }
os_free(reply);
}
@@ -1914,7 +1921,11 @@ static void hostapd_global_ctrl_iface_receive(int sock, void *eloop_ctx,
reply_len = 5;
}
- sendto(sock, reply, reply_len, 0, (struct sockaddr *) &from, fromlen);
+ if (sendto(sock, reply, reply_len, 0, (struct sockaddr *) &from,
+ fromlen) < 0) {
+ wpa_printf(MSG_DEBUG, "CTRL: sendto failed: %s",
+ strerror(errno));
+ }
}