Date: Saturday, February 12, 2022 @ 19:15:31 Author: arojas Revision: 437032
Fix connection issues on Broadcom drivers (FS#73495) Added: wpa_supplicant/trunk/add_extra-ies_only_if_allowed_by_driver.patch Modified: wpa_supplicant/trunk/PKGBUILD -----------------------------------------------+ PKGBUILD | 26 ++++------ add_extra-ies_only_if_allowed_by_driver.patch | 62 ++++++++++++++++++++++++ 2 files changed, 73 insertions(+), 15 deletions(-) Modified: PKGBUILD =================================================================== --- PKGBUILD 2022-02-12 18:33:49 UTC (rev 437031) +++ PKGBUILD 2022-02-12 19:15:31 UTC (rev 437032) @@ -1,10 +1,11 @@ -# Maintainer: Bartłomiej Piotrowski <[email protected]> +# Maintainer: +# Contributor: Bartłomiej Piotrowski <[email protected]> # Contributor: Thomas Bächler <[email protected]> # Contributor: loqs pkgname=wpa_supplicant pkgver=2.10 -pkgrel=1 +pkgrel=2 epoch=2 pkgdesc='A utility providing key negotiation for WPA wireless networks' url='https://w1.fi/wpa_supplicant/' @@ -18,6 +19,7 @@ wpa_supplicant_dbus_service_syslog.patch # Unit improvements from Ubuntu wpa_supplicant_service_ignore-on-isolate.patch # More unit improvements from Ubuntu wpa_supplicant_config + add_extra-ies_only_if_allowed_by_driver.patch ) validpgpkeys=('EC4AA0A991A5F2464582D52D2B6EF432EFC895FA') # Jouni Malinen sha256sums=('20df7ae5154b3830355f8ab4269123a87affdea59fe74fe9292a91d0d7e17b2f' @@ -25,25 +27,19 @@ '08915b040d03a3e07cdc8ea6c76b497e00059e01ce85b67413dfe41d4fc68992' '60f6a1cf2e124813dfce1da78ee1818e2ff5236aafa4113c7ae3b3f2a0b84006' 'd42bdbf3d4980b9f0a819612df0c39843c7e96c8afcb103aa656c824f93790b0' - '385c956607d9a4966b13458db60a29b7556ff0c9928d7fef59381678ce79f13b') + '385c956607d9a4966b13458db60a29b7556ff0c9928d7fef59381678ce79f13b' + 'aaedf87f1530d4e6cb00bf7981d1f868409ed892cc41b83c5613019e7b51f380') prepare() { - cd "$srcdir/$pkgname-$pkgver" - local src - for src in "${source[@]}"; do - src="${src%%::*}" - src="${src##*/}" - [[ $src = *.patch ]] || continue - echo "Applying patch $src..." - patch -Np1 < "../$src" - done + cd $pkgname-$pkgver + patch -p1 -i ../add_extra-ies_only_if_allowed_by_driver.patch # http://lists.infradead.org/pipermail/hostap/2022-January/040178.html - cd "$srcdir/$pkgname-$pkgver/$pkgname" + cd $pkgname cp "$srcdir/wpa_supplicant_config" ./.config } build() { - cd "$srcdir/$pkgname-$pkgver/$pkgname" + cd $pkgname-$pkgver/$pkgname make LIBDIR=/usr/lib BINDIR=/usr/bin make LIBDIR=/usr/lib BINDIR=/usr/bin eapol_test @@ -50,7 +46,7 @@ } package() { - cd "$srcdir/$pkgname-$pkgver/$pkgname" + cd $pkgname-$pkgver/$pkgname make LIBDIR=/usr/lib BINDIR=/usr/bin DESTDIR="$pkgdir" install install -Dm755 eapol_test "$pkgdir/usr/bin/eapol_test" Added: add_extra-ies_only_if_allowed_by_driver.patch =================================================================== --- add_extra-ies_only_if_allowed_by_driver.patch (rev 0) +++ add_extra-ies_only_if_allowed_by_driver.patch 2022-02-12 19:15:31 UTC (rev 437032) @@ -0,0 +1,62 @@ +Upgrading wpa_supplicant from 2.9 to 2.10 breaks broadcom-wl +based adapters. The reason for it is hostapd tries to install additional +IEs for scanning while the driver does not support this. + +The kernel indicates the maximum number of bytes for additional scan IEs +using the NL80211_ATTR_MAX_SCAN_IE_LEN attribute. Save this value and +only add additional scan IEs in case the driver can accommodate these +additional IEs. + +Reported-by: Étienne Morice <neon.emorice at mail.com> +Tested-by: Étienne Morice <neon.emorice at mail.com> +Signed-off-by: David Bauer <mail at david-bauer.net> +--- + src/drivers/driver.h | 3 +++ + src/drivers/driver_nl80211_capa.c | 4 ++++ + src/drivers/driver_nl80211_scan.c | 2 +- + 3 files changed, 8 insertions(+), 1 deletion(-) + +diff --git a/src/drivers/driver.h b/src/drivers/driver.h +index d3312a34d..b5b626451 100644 +--- a/src/drivers/driver.h ++++ b/src/drivers/driver.h +@@ -2052,6 +2052,9 @@ struct wpa_driver_capa { + /** Maximum number of iterations in a single scan plan */ + u32 max_sched_scan_plan_iterations; + ++ /** Maximum number of extra IE bytes for scans */ ++ u16 max_scan_ie_len; ++ + /** Whether sched_scan (offloaded scanning) is supported */ + int sched_scan_supported; + +diff --git a/src/drivers/driver_nl80211_capa.c b/src/drivers/driver_nl80211_capa.c +index 83868b78e..b33b6badb 100644 +--- a/src/drivers/driver_nl80211_capa.c ++++ b/src/drivers/driver_nl80211_capa.c +@@ -885,6 +885,10 @@ static int wiphy_info_handler(struct nl_msg *msg, void *arg) + nla_get_u32(tb[NL80211_ATTR_MAX_SCAN_PLAN_ITERATIONS]); + } + ++ if (tb[NL80211_ATTR_MAX_SCAN_IE_LEN]) ++ capa->max_scan_ie_len = ++ nla_get_u16(tb[NL80211_ATTR_MAX_SCAN_IE_LEN]); ++ + if (tb[NL80211_ATTR_MAX_MATCH_SETS]) + capa->max_match_sets = + nla_get_u8(tb[NL80211_ATTR_MAX_MATCH_SETS]); +diff --git a/src/drivers/driver_nl80211_scan.c b/src/drivers/driver_nl80211_scan.c +index 131608480..b0f095192 100644 +--- a/src/drivers/driver_nl80211_scan.c ++++ b/src/drivers/driver_nl80211_scan.c +@@ -207,7 +207,7 @@ nl80211_scan_common(struct i802_bss *bss, u8 cmd, + wpa_printf(MSG_DEBUG, "nl80211: Passive scan requested"); + } + +- if (params->extra_ies) { ++ if (params->extra_ies && drv->capa.max_scan_ie_len >= params->extra_ies_len) { + wpa_hexdump(MSG_MSGDUMP, "nl80211: Scan extra IEs", + params->extra_ies, params->extra_ies_len); + if (nla_put(msg, NL80211_ATTR_IE, params->extra_ies_len, +-- +2.35.1
