[PATCH] ft: defer PTK installation for unassociated AP clients

Andrea Covelli andcov23 at gmail.com
Thu Nov 12 15:02:53 PST 2026


On Sun, 18 Oct 2026, Giuseppe Piscitelli wrote:
> mac80211 rejects an ordinary FT PTK before the driver station is
> associated. hostapd retries after association, but the early request
> produces a key-add error for each transition.

I tested this patch on an mt76 AP, as a backport to the hostapd version
that OpenWrt 25.12.6 ships.

Setup:
- Cudy WR3000 v1 (MT7981, mt7915e driver), OpenWrt 25.12.6, kernel
  6.12.112, unmodified mac80211 (backports 6.18.55)
- hostapd 2025-08-26 (ca266cc2) with OpenWrt's patches, mbedTLS build
- This patch with the ap_sta_is_epp() condition left out, because that
  hostapd version has no EPP support. Otherwise unchanged.
- FT-PSK (WPA2), FT over the air, PMF disabled

Result, about 2 h 50 min after boot:
- 12 FT reassociations to this AP, from 6 clients
- no "nl80211: kernel reports: key addition failed"
- no other hostapd error in the log

For comparison, the OpenWrt pull request below reports the error on
10 of 10 FT roams with a stock OpenWrt build.

This does not cover PMF, so it does not reach the ap_sta_re_add()
branch. It does not cover FT over the DS or EPP either.

Checks that did not involve a radio:
- hostapd builds with -Werror with the patch on 831364bf, and in the
  form above on ca266cc2.
- I ran hostapd_wpa_auth_add_sta_ft(), ap_sta_re_add() and
  wpa_ft_install_ptk() against a driver stub that refuses a pairwise
  key for a station that is not associated. No case makes a refused
  set_key, including the PMF re-add, and the key is configured once,
  at the retry after association. Mesh, a driver without full AP
  client state, and EPP stations keep the early attempt.

One practical point: the mail is line-wrapped in four places, so
git am rejects it as archived. With those lines rejoined it applies to
its base commit and gives the blob IDs named in the mail. A resend
without the wrapping would make it easier to apply.

I have suggested that OpenWrt carry this patch:
https://github.com/openwrt/openwrt/pull/26652#issuecomment-6838107906

Tested-by: Andrea Covelli <andcov23 at gmail.com> # mt7915e, FT-PSK, no PMF



More information about the Hostap mailing list