From dd4e6a70f2f4eefab8a7dd663b881ba4f29bd5ba Mon Sep 17 00:00:00 2001
From: Rui Salvaterra <rsalvaterra@gmail.com>
Date: Mon, 2 Nov 2020 10:35:20 +0000
Subject: [PATCH] hostapd: enable the epoll-based event loop

Hostapd supports epoll() since 2014. Let's enable it for better performance.

Signed-off-by: Rui Salvaterra <rsalvaterra@gmail.com>
---
 package/network/services/hostapd/Makefile                       | 2 +-
 package/network/services/hostapd/files/hostapd-basic.config     | 2 +-
 package/network/services/hostapd/files/hostapd-full.config      | 2 +-
 package/network/services/hostapd/files/hostapd-mini.config      | 2 +-
 .../network/services/hostapd/files/wpa_supplicant-basic.config  | 2 +-
 .../network/services/hostapd/files/wpa_supplicant-full.config   | 2 +-
 .../network/services/hostapd/files/wpa_supplicant-mini.config   | 2 +-
 .../network/services/hostapd/files/wpa_supplicant-p2p.config    | 2 +-
 8 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/package/network/services/hostapd/Makefile b/package/network/services/hostapd/Makefile
index e25cd20a2a0b..1e20b5620095 100644
--- a/package/network/services/hostapd/Makefile
+++ b/package/network/services/hostapd/Makefile
@@ -7,7 +7,7 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=hostapd
-PKG_RELEASE:=16
+PKG_RELEASE:=17
 
 PKG_SOURCE_URL:=http://w1.fi/hostap.git
 PKG_SOURCE_PROTO:=git
diff --git a/package/network/services/hostapd/files/hostapd-basic.config b/package/network/services/hostapd/files/hostapd-basic.config
index 19ea850f6b87..947e2fa20052 100644
--- a/package/network/services/hostapd/files/hostapd-basic.config
+++ b/package/network/services/hostapd/files/hostapd-basic.config
@@ -268,7 +268,7 @@ CONFIG_GETRANDOM=y
 #CONFIG_ELOOP_POLL=y
 
 # Should we use epoll instead of select? Select is used by default.
-#CONFIG_ELOOP_EPOLL=y
+CONFIG_ELOOP_EPOLL=y
 
 # Should we use kqueue instead of select? Select is used by default.
 #CONFIG_ELOOP_KQUEUE=y
diff --git a/package/network/services/hostapd/files/hostapd-full.config b/package/network/services/hostapd/files/hostapd-full.config
index fee4479dfa10..df272e443a8a 100644
--- a/package/network/services/hostapd/files/hostapd-full.config
+++ b/package/network/services/hostapd/files/hostapd-full.config
@@ -268,7 +268,7 @@ CONFIG_GETRANDOM=y
 #CONFIG_ELOOP_POLL=y
 
 # Should we use epoll instead of select? Select is used by default.
-#CONFIG_ELOOP_EPOLL=y
+CONFIG_ELOOP_EPOLL=y
 
 # Should we use kqueue instead of select? Select is used by default.
 #CONFIG_ELOOP_KQUEUE=y
diff --git a/package/network/services/hostapd/files/hostapd-mini.config b/package/network/services/hostapd/files/hostapd-mini.config
index d9511441e648..b3050f7bbc70 100644
--- a/package/network/services/hostapd/files/hostapd-mini.config
+++ b/package/network/services/hostapd/files/hostapd-mini.config
@@ -268,7 +268,7 @@ CONFIG_GETRANDOM=y
 #CONFIG_ELOOP_POLL=y
 
 # Should we use epoll instead of select? Select is used by default.
-#CONFIG_ELOOP_EPOLL=y
+CONFIG_ELOOP_EPOLL=y
 
 # Should we use kqueue instead of select? Select is used by default.
 #CONFIG_ELOOP_KQUEUE=y
diff --git a/package/network/services/hostapd/files/wpa_supplicant-basic.config b/package/network/services/hostapd/files/wpa_supplicant-basic.config
index db3f7c7a11bb..c550b37b21b3 100644
--- a/package/network/services/hostapd/files/wpa_supplicant-basic.config
+++ b/package/network/services/hostapd/files/wpa_supplicant-basic.config
@@ -290,7 +290,7 @@ CONFIG_NO_CONFIG_WRITE=y
 #CONFIG_ELOOP_POLL=y
 
 # Should we use epoll instead of select? Select is used by default.
-#CONFIG_ELOOP_EPOLL=y
+CONFIG_ELOOP_EPOLL=y
 
 # Should we use kqueue instead of select? Select is used by default.
 #CONFIG_ELOOP_KQUEUE=y
diff --git a/package/network/services/hostapd/files/wpa_supplicant-full.config b/package/network/services/hostapd/files/wpa_supplicant-full.config
index 4dd3e550a68d..b3e85d073d5c 100644
--- a/package/network/services/hostapd/files/wpa_supplicant-full.config
+++ b/package/network/services/hostapd/files/wpa_supplicant-full.config
@@ -290,7 +290,7 @@ CONFIG_BACKEND=file
 #CONFIG_ELOOP_POLL=y
 
 # Should we use epoll instead of select? Select is used by default.
-#CONFIG_ELOOP_EPOLL=y
+CONFIG_ELOOP_EPOLL=y
 
 # Should we use kqueue instead of select? Select is used by default.
 #CONFIG_ELOOP_KQUEUE=y
diff --git a/package/network/services/hostapd/files/wpa_supplicant-mini.config b/package/network/services/hostapd/files/wpa_supplicant-mini.config
index c1e0141edda6..9eb1111e523e 100644
--- a/package/network/services/hostapd/files/wpa_supplicant-mini.config
+++ b/package/network/services/hostapd/files/wpa_supplicant-mini.config
@@ -290,7 +290,7 @@ CONFIG_NO_CONFIG_WRITE=y
 #CONFIG_ELOOP_POLL=y
 
 # Should we use epoll instead of select? Select is used by default.
-#CONFIG_ELOOP_EPOLL=y
+CONFIG_ELOOP_EPOLL=y
 
 # Should we use kqueue instead of select? Select is used by default.
 #CONFIG_ELOOP_KQUEUE=y
diff --git a/package/network/services/hostapd/files/wpa_supplicant-p2p.config b/package/network/services/hostapd/files/wpa_supplicant-p2p.config
index 515604828484..b00847a2565f 100644
--- a/package/network/services/hostapd/files/wpa_supplicant-p2p.config
+++ b/package/network/services/hostapd/files/wpa_supplicant-p2p.config
@@ -290,7 +290,7 @@ CONFIG_BACKEND=file
 #CONFIG_ELOOP_POLL=y
 
 # Should we use epoll instead of select? Select is used by default.
-#CONFIG_ELOOP_EPOLL=y
+CONFIG_ELOOP_EPOLL=y
 
 # Should we use kqueue instead of select? Select is used by default.
 #CONFIG_ELOOP_KQUEUE=y
-- 
2.30.2