From 630b3230c86abf1976a39db596c51540e57e31c8 Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Thu, 22 Jan 2015 13:51:15 +0200 Subject: [PATCH] nl80211: Increase netlink receive buffer size libnl uses a pretty small buffer (32 kB that gets converted to 64 kB) by default. It is possible to hit that limit in some cases where operations are blocked, e.g., with a burst of Deauthentication frames to hostapd and STA entry deletion. Try to increase the buffer to make this less likely to occur. Signed-off-by: Jouni Malinen --- src/drivers/driver_nl80211.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/drivers/driver_nl80211.c b/src/drivers/driver_nl80211.c index 3ed985117..709536a3f 100644 --- a/src/drivers/driver_nl80211.c +++ b/src/drivers/driver_nl80211.c @@ -132,6 +132,20 @@ static void nl80211_register_eloop_read(struct nl_handle **handle, eloop_sock_handler handler, void *eloop_data) { + /* + * libnl uses a pretty small buffer (32 kB that gets converted to 64 kB) + * by default. It is possible to hit that limit in some cases where + * operations are blocked, e.g., with a burst of Deauthentication frames + * to hostapd and STA entry deletion. Try to increase the buffer to make + * this less likely to occur. + */ + if (nl_socket_set_buffer_size(*handle, 262144, 0) < 0) { + wpa_printf(MSG_DEBUG, + "nl80211: Could not set nl_socket RX buffer size: %s", + strerror(errno)); + /* continue anyway with the default (smaller) buffer */ + } + nl_socket_set_nonblocking(*handle); eloop_register_read_sock(nl_socket_get_fd(*handle), handler, eloop_data, *handle);