Page MenuHomeFreeBSD

D42558.diff
No OneTemporary

D42558.diff

diff --git a/contrib/wpa/wpa_supplicant/ctrl_iface_unix.c b/contrib/wpa/wpa_supplicant/ctrl_iface_unix.c
--- a/contrib/wpa/wpa_supplicant/ctrl_iface_unix.c
+++ b/contrib/wpa/wpa_supplicant/ctrl_iface_unix.c
@@ -506,6 +506,10 @@
struct group *grp;
char *endp;
int flags;
+#if defined(__FreeBSD__)
+ int optval, rc;
+ socklen_t optlen;
+#endif
buf = os_strdup(wpa_s->conf->ctrl_interface);
if (buf == NULL)
@@ -679,6 +683,22 @@
}
}
+#if defined(__FreeBSD__)
+ /* Ensure we can send a full length message atomically. */
+ optval = 0;
+ optlen = sizeof(optval);
+ if (getsockopt(priv->sock, SOL_SOCKET, SO_SNDBUF, &optval, &optlen) == -1) {
+ wpa_printf(MSG_INFO, "failed to get sndbuf for sock=%d: %s",
+ priv->sock, strerror(errno));
+ } else if (optval < CTRL_IFACE_MAX_LEN) {
+ optval = CTRL_IFACE_MAX_LEN;
+ if (setsockopt(priv->sock, SOL_SOCKET, SO_SNDBUF, &optval,
+ sizeof(optval)) == -1)
+ wpa_printf(MSG_ERROR, "failed to set sndbuf for "
+ "sock=%d: %s", priv->sock, strerror(errno));
+ }
+#endif
+
eloop_register_read_sock(priv->sock, wpa_supplicant_ctrl_iface_receive,
wpa_s, priv);
wpa_msg_register_cb(wpa_supplicant_ctrl_iface_msg_cb);

File Metadata

Mime Type
text/plain
Expires
Fri, Nov 8, 9:03 PM (8 h, 16 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
14501439
Default Alt Text
D42558.diff (1 KB)

Event Timeline