]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
nl80211: Increase netlink receive buffer size
authorJouni Malinen <jouni@qca.qualcomm.com>
Thu, 22 Jan 2015 11:51:15 +0000 (13:51 +0200)
committerJouni Malinen <j@w1.fi>
Thu, 22 Jan 2015 11:51:15 +0000 (13:51 +0200)
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 <jouni@qca.qualcomm.com>
src/drivers/driver_nl80211.c

index 3ed98511754a72bd0274541ec7c78658ca3d5ed1..709536a3f61af5c2d3e8fdcfd28b47722a757a72 100644 (file)
@@ -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);