diff mbox series

hostapd: reorganize config selection hierarchy for WPA3

Message ID 20200729200917.33695-1-freifunk@adrianschmutzler.de
State Accepted
Delegated to: Adrian Schmutzler
Headers show
Series hostapd: reorganize config selection hierarchy for WPA3 | expand

Commit Message

Adrian Schmutzler July 29, 2020, 8:09 p.m. UTC
The current selection of DRIVER_MAKEOPTS and TARGET_LDFLAGS is
exceptionally hard to read. This tries to make things a little
easier by inverting the hierarchy of the conditions, so SSL_VARIANT
is checked first and LOCAL_VARIANT is checked second.

This exploits the fact that some of the previous conditions were
unnecessary, e.g. openssl is only available for mesh/full and not
available for hostapd, so we don't need to check that.

It also should make it a little easier to see which options are
actually switched by SSL_VARIANT and which by LOCAL_VARIANT.

The patch is supposed to be cosmetic.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>

---

This is based on ynezz' patch "hostapd: add wpad-basic-wolfssl variant".
---
 package/network/services/hostapd/Makefile | 39 ++++++++++-------------
 1 file changed, 17 insertions(+), 22 deletions(-)

Comments

Adrian Schmutzler July 29, 2020, 8:16 p.m. UTC | #1
> -----Original Message-----
> From: openwrt-devel [mailto:openwrt-devel-bounces@lists.openwrt.org]
> On Behalf Of Adrian Schmutzler
> Sent: Mittwoch, 29. Juli 2020 22:09
> To: openwrt-devel@lists.openwrt.org
> Subject: [PATCH] hostapd: reorganize config selection hierarchy for WPA3
> 
> The current selection of DRIVER_MAKEOPTS and TARGET_LDFLAGS is
> exceptionally hard to read. This tries to make things a little easier by inverting
> the hierarchy of the conditions, so SSL_VARIANT is checked first and
> LOCAL_VARIANT is checked second.
> 
> This exploits the fact that some of the previous conditions were
> unnecessary, e.g. openssl is only available for mesh/full and not available for
> hostapd, so we don't need to check that.

This paragraph of the commit message is wrong, but the implementation should be correct ...

Adrian
diff mbox series

Patch

diff --git a/package/network/services/hostapd/Makefile b/package/network/services/hostapd/Makefile
index df1a80d3da..49be98fba2 100644
--- a/package/network/services/hostapd/Makefile
+++ b/package/network/services/hostapd/Makefile
@@ -98,36 +98,31 @@  ifneq ($(LOCAL_VARIANT),mini)
   DRIVER_MAKEOPTS += CONFIG_IEEE80211W=$(CONFIG_DRIVER_11W_SUPPORT)
 endif
 
-ifeq ($(LOCAL_VARIANT),full)
-  ifeq ($(SSL_VARIANT),openssl)
-    DRIVER_MAKEOPTS += CONFIG_TLS=openssl CONFIG_SAE=y CONFIG_OWE=y CONFIG_SUITEB192=y CONFIG_AP=y CONFIG_MESH=y
-    TARGET_LDFLAGS += -lcrypto -lssl
+ifeq ($(SSL_VARIANT),openssl)
+  DRIVER_MAKEOPTS += CONFIG_TLS=openssl CONFIG_SAE=y
+  TARGET_LDFLAGS += -lcrypto -lssl
+
+  ifeq ($(LOCAL_VARIANT),mesh)
+    DRIVER_MAKEOPTS += CONFIG_AP=y CONFIG_MESH=y
   endif
-  ifeq ($(SSL_VARIANT),wolfssl)
-    DRIVER_MAKEOPTS += CONFIG_TLS=wolfssl CONFIG_WPS_NFC=1 CONFIG_SAE=y CONFIG_OWE=y CONFIG_SUITEB192=y CONFIG_AP=y CONFIG_MESH=y
-    TARGET_LDFLAGS += -lwolfssl
+  ifeq ($(LOCAL_VARIANT),full)
+    DRIVER_MAKEOPTS += CONFIG_OWE=y CONFIG_SUITEB192=y CONFIG_AP=y CONFIG_MESH=y
   endif
 endif
 
-ifeq ($(LOCAL_VARIANT),basic)
-  ifeq ($(SSL_VARIANT),wolfssl)
-    DRIVER_MAKEOPTS += CONFIG_TLS=wolfssl CONFIG_SAE=y
-    TARGET_LDFLAGS += -lwolfssl
-  endif
-endif
+ifeq ($(SSL_VARIANT),wolfssl)
+  DRIVER_MAKEOPTS += CONFIG_TLS=wolfssl CONFIG_SAE=y
+  TARGET_LDFLAGS += -lwolfssl
 
-ifneq ($(LOCAL_TYPE),hostapd)
   ifeq ($(LOCAL_VARIANT),mesh)
-    ifeq ($(SSL_VARIANT),openssl)
-      DRIVER_MAKEOPTS += CONFIG_TLS=openssl CONFIG_AP=y CONFIG_SAE=y CONFIG_MESH=y
-      TARGET_LDFLAGS += -lcrypto -lssl
-    endif
-    ifeq ($(SSL_VARIANT),wolfssl)
-      DRIVER_MAKEOPTS += CONFIG_TLS=wolfssl CONFIG_WPS_NFC=1 CONFIG_AP=y CONFIG_SAE=y CONFIG_MESH=y
-      TARGET_LDFLAGS += -lwolfssl
-    endif
+    DRIVER_MAKEOPTS += CONFIG_AP=y CONFIG_MESH=y CONFIG_WPS_NFC=1
+  endif
+  ifeq ($(LOCAL_VARIANT),full)
+    DRIVER_MAKEOPTS += CONFIG_OWE=y CONFIG_SUITEB192=y CONFIG_AP=y CONFIG_MESH=y CONFIG_WPS_NFC=1
   endif
+endif
 
+ifneq ($(LOCAL_TYPE),hostapd)
   ifdef CONFIG_WPA_RFKILL_SUPPORT
     DRIVER_MAKEOPTS += NEED_RFKILL=y
   endif