Skip to content

fix(agent): scan neighbors per interface with own timeout - #1388

Merged
gnacho merged 1 commit into
mainfrom
fix/1338-scan-timeout
Oct 13, 2026
Merged

gnacho merged 1 commit into
mainfrom
fix/1338-scan-timeout

Conversation

@gnacho

@gnacho gnacho commented Oct 13, 2026

Copy link
Copy Markdown
Owner

Why

The neighbor scan ran as a single shell loop over every wireless interface with one shared 10 s timeout, and the runner discarded the partial output when the deadline killed the loop. On units whose 5 GHz radio sits on a DFS channel (slow passive scan, e.g. the UniFi 6 Lite / mt7621 from #1338), the loop was killed before the 2.4 GHz interfaces were scanned, so the agent reported no neighbors at all and the channel analysis only ever listed the unit's own SSIDs.

What

  • Scan each interface as its own command (CmdScanIface) with its own 8 s budget, enumerated from a single iw dev call that also feeds the own-BSSID section.
  • A slow or stuck radio now only empties its own section instead of taking down every interface's results.
  • The monolithic CmdScan literal stays exported, deprecated, for vendored module consumers.
  • OpenWrt busybox has no timeout applet, so the isolation lives in the Go runner, not in shell.

Tests

  • New scan_periface_test.go: a dead 5 GHz scan no longer starves the 2.4 GHz results (fixture is the exact scan output the reporter pasted, including its double last seen lines), throttle still governs per-interface scans, no-iw units stay quiet.
  • scan_throttle_test.go updated to the per-interface commands.
  • Agent module: vet clean, full suite green. Server: 48/48 packages with -count=1.

Refs #1338

The neighbor scan ran as a single shell loop over every wireless
interface with one shared 10 s budget, and the runner discarded the
partial output when the deadline killed it. On units whose 5 GHz radio
sits on a DFS channel (slow passive scan, e.g. UniFi 6 Lite / mt7621)
the whole loop was killed before the 2.4 GHz interfaces finished, so
the agent reported no neighbors at all and the channel analysis only
ever listed the unit's own SSIDs.

Scan each interface as its own command (8 s budget each), reusing a
single iw dev call to enumerate interfaces and to feed the own-BSSID
section. A slow or stuck radio now only empties its own section. The
monolithic CmdScan literal stays exported (deprecated) for vendored
consumers.

Refs #1338
@gnacho
gnacho merged commit 9f3c18e into main Oct 13, 2026
2 checks passed
@gnacho
gnacho deleted the fix/1338-scan-timeout branch October 13, 2026 17:56
gnacho added a commit that referenced this pull request Oct 13, 2026
Ships the per-interface neighbor scan fix (#1388, refs #1338) to self-updating agents on the next release. Agent module tagged agent/v1.5.3 for vendored consumers.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant