[openwrt/openwrt] hostapd: increase netlink buffer size

LEDE Commits lede-commits at lists.infradead.org
Sat Oct 18 12:59:47 PDT 2025


nbd pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/0535d615f6992f1ebe9b0f368cacdb5d5c59301a

commit 0535d615f6992f1ebe9b0f368cacdb5d5c59301a
Author: Felix Fietkau <nbd at nbd.name>
AuthorDate: Sat Oct 18 19:58:45 2025 +0000

    hostapd: increase netlink buffer size
    
    When lots of events are waiting to be received, the default buffer size
    is not enough, and hostapd can run into "No buffer space available" on
    recvmsg. This will cause the netdev state tracking to go out of sync.
    
    Signed-off-by: Felix Fietkau <nbd at nbd.name>
---
 .../patches/070-netlink-increase-buffer-size.patch | 31 ++++++++++++++++++++++
 1 file changed, 31 insertions(+)

diff --git a/package/network/services/hostapd/patches/070-netlink-increase-buffer-size.patch b/package/network/services/hostapd/patches/070-netlink-increase-buffer-size.patch
new file mode 100644
index 0000000000..3f1952f1e3
--- /dev/null
+++ b/package/network/services/hostapd/patches/070-netlink-increase-buffer-size.patch
@@ -0,0 +1,31 @@
+From: Felix Fietkau <nbd at nbd.name>
+Date: Sat, 18 Oct 2025 21:55:44 +0200
+Subject: [PATCH] netlink: increase buffer size
+
+When lots of events are waiting to be received, the default buffer size
+is not enough, and hostapd can run into "No buffer space available" on
+recvmsg. This will cause the netdev state tracking to go out of sync.
+
+Signed-off-by: Felix Fietkau <nbd at nbd.name>
+---
+
+--- a/src/drivers/netlink.c
++++ b/src/drivers/netlink.c
+@@ -92,6 +92,7 @@ struct netlink_data * netlink_init(struc
+ {
+ 	struct netlink_data *netlink;
+ 	struct sockaddr_nl local;
++	int size = 262144;
+ 
+ 	netlink = os_zalloc(sizeof(*netlink));
+ 	if (netlink == NULL)
+@@ -105,6 +106,9 @@ struct netlink_data * netlink_init(struc
+ 		return NULL;
+ 	}
+ 
++	setsockopt(netlink->sock, SOL_SOCKET, SO_RCVBUF, &size, sizeof(size));
++	setsockopt(netlink->sock, SOL_SOCKET, SO_SNDBUF, &size, sizeof(size));
++
+ 	os_memset(&local, 0, sizeof(local));
+ 	local.nl_family = AF_NETLINK;
+ 	local.nl_groups = RTMGRP_LINK;




More information about the lede-commits mailing list