[OpenWrt-Devel] [PATCH] hostapd: fix #18197, no auth server (BB)

Leon Merten Lohse leon at green-side.de
Thu Jul 16 08:36:55 EDT 2015


(++attempts)

As described in [1], there was a bug in hostapd introduced in version 
2.2 that
makes hostapd lose its RADIUS configuration if the initial connection 
attempt
failed.
This is serious, because it effectively renders WPA-Enterprise 
authentication
unuseable. When the network interfaces are brought up, the wired 
connection
most likely does not have a dhcp lease yet.
The bug was fixed upstream, however the version used in Barrier Breaker 
still has
it. More information in the upstream commit [2].

The included patch (git diff) simply applies the upstream patch using 
quilt.
Tested successfully by me with the latest Barrier Breaker from git on a 
WNDR3800.

Best Regards
Leon

[1] https://dev.openwrt.org/ticket/18197
[2] 
https://w1.fi/cgit/hostap/commit/src/radius/radius_client.c?id=94b39e5927e570e6b0fe41d455dde0a361c71c36

Signed-⁠off-⁠by: Leon Merten Lohse <leon at green-side.de>

diff --git 
a/package/network/services/hostapd/patches/700-radius_reconnect.patch 
b/package/network/services/hostapd/patches/700-radius_reconnect.patch
new file mode 100644
index 0000000..acc9804
-⁠-⁠-⁠ /⁠dev/⁠null
+++ 
b/package/network/services/hostapd/patches/700-radius_reconnect.patch
@@ -⁠0,0 +1,22 @@
+-⁠-⁠-⁠ a/⁠src/⁠radius/⁠radius_client.c
++++ b/⁠src/⁠radius/⁠radius_client.c
+@@ -⁠658,6 +658,9 @@ int radius_client_send(struct radius_cli
+       }
+
+       if (msg_type == RADIUS_ACCT || msg_type == RADIUS_ACCT_INTERIM) 
{
++              if (conf-⁠>acct_server && radius-⁠>acct_sock < 0)
++                      radius_client_init_acct(radius);
++
+               if (conf->acct_server == NULL || radius->acct_sock < 0) 
{
+                       hostapd_logger(radius-⁠>ctx, NULL,
+                                      HOSTAPD_MODULE_RADIUS,
+@@ -⁠672,6 +675,9 @@ int radius_client_send(struct radius_cli
+               s = radius-⁠>acct_sock;
+               conf-⁠>acct_server-⁠>requests++;
+       } else {
++              if (conf-⁠>auth_server && radius-⁠>auth_sock < 0)
++                      radius_client_init_auth(radius);
++
+               if (conf->auth_server == NULL || radius->auth_sock < 0) 
{
+                       hostapd_logger(radius-⁠>ctx, NULL,
+                                      HOSTAPD_MODULE_RADIUS,
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


More information about the openwrt-devel mailing list