[pkg-wpa-devel] Bug#854719: Bug#854719: Bug#854719: hostapd: Failed to set beacon parameters

Vincent Danjean vdanjean.ml at free.fr
Fri Feb 10 09:41:24 UTC 2017


  Hi,

Le 10/02/2017 à 00:21, Andrew Shadura a écrit :
> On 10/02/17 00:05, Vincent Danjean wrote:
>> I'm not using wpa_supplicant, so it does not seem the same bug.
>> Moreover, the proposed patch in
>> http://lists.infradead.org/pipermail/hostap/2017-January/037060.html
>> do not apply at all for the testing sources.
>> In the testing sources, in the wpa_driver_nl80211_set_ap function,
>> the "if (beacon_set)" test do not have any "else" clause to patch.
> 
> That doesn't sound good. Maybe try emailing the hostap mailing list?

I use git-bissect to find what makes hostapd 2.6 working on my hardware.
I found the ee298f1b1f7efd7eb5fd510f36b25ff88208017c. It fixes some
code just before the error in the provided log. So, I tried to
apply the following patch to the testing debian package (ie the
upstream commit + a change in build-dependency to use openssl 1.0)
and it seems to work.

  Regards
    Vincent

-- 
Vincent Danjean       GPG key ID 0xD17897FA         vdanjean at debian.org
GPG key fingerprint: 621E 3509 654D D77C 43F5  CA4A F6AE F2AF D178 97FA
Unofficial pkgs: http://moais.imag.fr/membres/vincent.danjean/deb.html
APT repo:  deb http://people.debian.org/~vdanjean/debian unstable main

-------------- next part --------------
diff --git a/debian/changelog b/debian/changelog
index 704f538..45f48d3 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,10 @@
+wpa (2.5-2+v2.4-3.1) unstable; urgency=medium
+
+  * Non-maintainer upload.
+  * Test with a patch backported from upstream
+
+ -- Vincent Danjean <vdanjean at debian.org>  Fri, 10 Feb 2017 10:21:51 +0100
+
 wpa (2.5-2+v2.4-3) unstable; urgency=medium
 
   [ Helmut Grohne ]
diff --git a/debian/control b/debian/control
index c9a4aa0..beae8ee 100644
--- a/debian/control
+++ b/debian/control
@@ -8,7 +8,7 @@ Section: net
 Priority: optional
 Build-Depends: debhelper (>> 9.20120115),
  libdbus-1-dev,
- libssl-dev,
+ libssl1.0-dev,
  libqt4-dev,
  libncurses5-dev,
  libpcsclite-dev,
diff --git a/debian/patches/from-upstream-hostapd-fix-SMPS-mode.patch b/debian/patches/from-upstream-hostapd-fix-SMPS-mode.patch
new file mode 100644
index 0000000..5a6408a
--- /dev/null
+++ b/debian/patches/from-upstream-hostapd-fix-SMPS-mode.patch
@@ -0,0 +1,54 @@
+nl80211: Do not add NL80211_ATTR_SMPS_MODE attribute if HT is disabled
+    
+SMPS mode is applicable only for HT and including an attribute to
+configure it when HT is disabled could result in the AP start operation
+failing. Fix this by adding the attribute only in cases where HT is
+enabled.
+
+Upstream commit ee298f1b1f7efd7eb5fd510f36b25ff88208017c
+--- a/src/drivers/driver_nl80211.c
++++ b/src/drivers/driver_nl80211.c
+@@ -3419,24 +3419,26 @@
+ 	    nla_put_u32(msg, NL80211_ATTR_CIPHER_SUITE_GROUP, suite))
+ 		goto fail;
+ 
+-	switch (params->smps_mode) {
+-	case HT_CAP_INFO_SMPS_DYNAMIC:
+-		wpa_printf(MSG_DEBUG, "nl80211: SMPS mode - dynamic");
+-		smps_mode = NL80211_SMPS_DYNAMIC;
+-		break;
+-	case HT_CAP_INFO_SMPS_STATIC:
+-		wpa_printf(MSG_DEBUG, "nl80211: SMPS mode - static");
+-		smps_mode = NL80211_SMPS_STATIC;
+-		break;
+-	default:
+-		/* invalid - fallback to smps off */
+-	case HT_CAP_INFO_SMPS_DISABLED:
+-		wpa_printf(MSG_DEBUG, "nl80211: SMPS mode - off");
+-		smps_mode = NL80211_SMPS_OFF;
+-		break;
++	if (params->ht_opmode != -1) {
++		switch (params->smps_mode) {
++		case HT_CAP_INFO_SMPS_DYNAMIC:
++			wpa_printf(MSG_DEBUG, "nl80211: SMPS mode - dynamic");
++			smps_mode = NL80211_SMPS_DYNAMIC;
++			break;
++		case HT_CAP_INFO_SMPS_STATIC:
++			wpa_printf(MSG_DEBUG, "nl80211: SMPS mode - static");
++			smps_mode = NL80211_SMPS_STATIC;
++			break;
++		default:
++			/* invalid - fallback to smps off */
++		case HT_CAP_INFO_SMPS_DISABLED:
++			wpa_printf(MSG_DEBUG, "nl80211: SMPS mode - off");
++			smps_mode = NL80211_SMPS_OFF;
++			break;
++		}
++		if (nla_put_u32(msg, NL80211_ATTR_SMPS_MODE, smps_mode))
++			goto fail;
+ 	}
+-	if (nla_put_u32(msg, NL80211_ATTR_SMPS_MODE, smps_mode))
+-		goto fail;
+ 
+ 	if (params->beacon_ies) {
+ 		wpa_hexdump_buf(MSG_DEBUG, "nl80211: beacon_ies",
diff --git a/debian/patches/series b/debian/patches/series
index c64ac14..35abe22 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -31,3 +31,4 @@ nl80211_dont_call_linux_iface_up_for_a_dedicated_p2p_device.patch
 do_not_wait_for_monitor_to_attach_if_no_control_interface.patch
 wpa_supplicant_do_not_wait_for_monitor_on_p2p_device_interface.patch
 openssl-initialise-pkcs-11.patch
+from-upstream-hostapd-fix-SMPS-mode.patch


More information about the Pkg-wpa-devel mailing list