Skip to content

fix(start-wrt): backport hostapd GTK rekey fix for dynamic VLANs - #4968

Open
helix-red wants to merge 1 commit into
masterfrom
fix/wrt-hostapd-vlan-gtk-rekey
Open

helix-red wants to merge 1 commit into
masterfrom
fix/wrt-hostapd-vlan-gtk-rekey

Conversation

@helix-red

@helix-red helix-red commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor

Closes #4967

Not yet verified on hardware. No router has run this fix with real Wi-Fi clients. The image for this head builds and is ready to flash: run 45767425974 (startwrt-1.5.0-cab64d9_spacemit-k1-sysupgrade.img.gz).

Summary

This change ships the upstream hostapd fix for a bug that cuts off broadcast traffic between Wi-Fi devices on the same security profile. The bug appears after the router has been up for about a day, and a reboot clears it.

Cause

StartWRT puts Wi-Fi clients on profiles using hostapd dynamic VLANs. Each profile VLAN has its own group key (GTK), the key that encrypts broadcast and multicast frames. hostapd rotates the GTK every 86400 s by default (wpa_group_rekey), and StartWRT does not set that option.

In the hostapd version pinned by OpenWrt 25.12.6 (ca266cc24), wpa_group_sm_step_links() advances the default VLAN's group state machine instead of the group for the station's own VLAN. After a rekey, each profile VLAN's group therefore stops before it installs the new GTK as its transmit key. A station that reconnects in the meantime receives the new GTK but keeps getting frames encrypted with the old one, so it can't decrypt broadcast or multicast. ARP requests, mDNS and Cast discovery are lost. Unicast still works, and so does traffic the router routes between profiles. Restarting the router restarts hostapd and clears the state until the next rekey.

That fits every report in the issue:

  • ping fails between two devices on the same profile, because the ARP request never arrives
  • ping works across profiles
  • Fing finds only some devices
  • a reboot fixed it, and fixed the reporter's earlier printer problem the same way

Upstream's fix is hostap ace76dd0f9dcc. OpenWrt main has it through hostapd 2.12. The 25.12 backport, openwrt/openwrt#26509, is still open. Its author reproduced the bug on OpenWrt 25.12.6 with dynamic VLANs from wpa_psk_file, which is StartWRT's setup, and confirmed the fix there.

The fix removes the cause. The alternative, disabling GTK rekeying (wpa_group_rekey=0), would hide the bug and leave the broadcast key unchanged for the router's whole uptime.

Change

The change follows the ca-certificates backport precedent from #4783:

  • openwrt-overlay/package/network/services/hostapd/patches/008-VLAN-step-the-station-s-own-group-state-machine.patch is #26509's package patch, byte for byte. It is the one-line non-MLO part of ace76dd0f9dcc; the MLO parts need an API this hostapd version lacks.
  • openwrt-patches/0014-hostapd-fix-gtk-rekey-on-dynamic-vlans.patch bumps hostapd's PKG_RELEASE from 6 to 7, so the package gets rebuilt.
  • Both patch headers say to drop the patches once the pinned OpenWrt release contains the fix.
  • The overlay README's license table and NOTICE.md now credit the hostapd contributors (BSD-3-Clause), and the overlay list in projects/start-wrt/AGENTS.md includes the hostapd patch.
  • The changelog fragment is patch tier with release-notes: true.

Implementation diff: +61 / −0 lines in 2 files (excludes lockfiles, tests, docs, release notes, and changelog).

Rollout

The fix takes effect when a router installs a firmware image containing it. Nothing changes in configuration, and no existing state needs migrating. Routers on 1.4.0 can work around the bug by rebooting until they update.

Testing

  • openwrt-setup.sh --tree-only rebuilt the pinned v25.12.6 tree with every Start9 patch and the overlay. The resulting hostapd Makefile has PKG_RELEASE:=7, and the 008 patch sits in the package's patch list.
  • All 70 hostapd patches applied in order to hostap ca266cc24, the pinned source. None of the other patches touches the changed line.
  • changelog.mjs check-version and Prettier pass.
  • A manually dispatched image build of this head (build-image; PR CI skips images on non-integration branches) succeeded. It applied 008-VLAN-step-the-station-s-own-group-state-machine.patch to src/ap/wpa_auth.c, compiled hostapd-basic-mbedtls 2025.08.26~ca266cc2 r7 for riscv64, produced the sd-card and sysupgrade images, and passed the image trust-store check.
  • Not run: an end-to-end Wi-Fi test. The bench has no Wi-Fi client.

model: claude-opus-5-5

Helix-Harness: claude-code
Helix-Model: claude-opus-5-5

After the daily GTK rekey, hostapd 25.12 stepped the default VLAN's group
state machine instead of the station's own VLAN group, so each profile VLAN
kept transmitting with the old group key. Stations that reconnected in
between could not decrypt broadcast or multicast frames, so ARP, mDNS and
Cast discovery between same-profile Wi-Fi clients failed until a reboot.

Carries openwrt/openwrt#26509 until the pinned release includes it.

Closes #4967

Helix-Harness: claude-code
Helix-Model: claude-opus-5-5

@helix-white helix-white left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved at cab64d9. The package patch matches OpenWrt #26509 byte-for-byte and the non-MLO hunk of hostap ace76dd0f9dcc. In the pinned source, sm->group is the station's reference-counted VLAN group; stepping it completes the GTK installation after the last acknowledgement and preserves default-VLAN behavior. The overlay path and package-release bump match the pinned OpenWrt tree. Merge-tree is clean against current master.

Source review only; no builds or tests run. The reported upstream reproduction supports this backport, but does not confirm the customer's exact cause. The image-build and real Wi-Fi verification gaps remain as disclosed.

Before handoff, add the required StartWRT, repo, and patch labels and the model: claude-opus-5-5 line to the description.

Helix-Harness: pi
Helix-Model: openai-codex/gpt-6.1-sol

@helix-red helix-red added StartWRT repo Repository maintenance patch labels Nov 26, 2026
@helix-red
helix-red requested a review from dr-bonez November 26, 2026 06:20

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

patch repo Repository maintenance StartWRT

Projects

None yet

Development

Successfully merging this pull request may close these issues.

StartWRT 1.4.0: Wi-Fi clients on the same security profile cannot reach each other, while cross-profile traffic works

2 participants