Skip to content

RDKEMW-26238: Incorrect Wi-Fi status in ConnectionStats.log and WiFi self-heal broken after WiFi toggle (Off and On) from UI - #633

Merged
nhanasi merged 1 commit into
support/5.1.0_releasefrom
topic/RDKEMW-26238
Oct 22, 2026
Merged

nhanasi merged 1 commit into
support/5.1.0_releasefrom
topic/RDKEMW-26238

Conversation

@tukken-comcast

Copy link
Copy Markdown
Contributor

Reason for change: Fix false TELEMETRY_WIFI_NOT_CONNECTED after wifi toggle

Details: In the network connection recovery script, checkWifiConnected() determined wifi state with "wpa_cli status", which needs wpa_supplicant's per-interface control socket. NetworkManager creates supplicant interfaces over D-Bus passing only Driver and Ifname, so an interface it re-creates gets an empty config with no ctrl_interface and no socket. Any wifi toggle (SetInterfaceState, nmcli radio wifi off/on, rfkill) therefore leaves wpa_cli broken for the life of the wpa_supplicant process.

The probe then reported "not connected" while wifi was up. That logged a false TELEMETRY_WIFI_NOT_CONNECTED and, worse, left both IsEthernetConnected and IsWifiConnected at 0 so neither branch of the main flow ran: no gateway packet-loss telemetry and no wifi recovery ladder until the next maintenance reboot.

Take wifi state from the kernel instead, so the probe cannot be broken by the subsystem it is watching:

  • checkWifiConnected() uses "iw dev link" (nl80211), which needs no control socket, no daemon and no config prerequisite. The LNF SSIDs are hidden, so the SSID used for the LNF match comes from "iw dev info" (kernel station state), falling back to the SSID: line of "iw link".
  • Drop the /tmp/wifi-on gate, a second piece of derived state that can drift and produce the same symptom. The file and its other producers and consumers are unchanged.
  • wifiReassociate() calls fi.w1.wpa_supplicant1.Interface.Reassociate over D-Bus instead of "wpa_cli reassociate". Both are wpas_request_connection() behind the same WPA_INTERFACE_DISABLED guard, so the operation is identical, but D-Bus does not depend on the control socket. The wpa_cli form is kept as a comment because it remains the short hand-run equivalent for triage.
  • Log whether the reassociate was actually performed. IsWifiReassociated stays unconditional: it is the escalation rung counter, and gating it on success would stop the ladder ever reaching wifiReset.

Telemetry markers and every t2CountNotify call are byte-identical, and escalation timing is unchanged. Verified on an 8.6 build, including LNF detection on a device connected to the LNF enterprise SSID.

Test Procedure: See ticket
Priority: P1
Risk: Low

… toggle

checkWifiConnected() determined wifi state with "wpa_cli status", which needs
wpa_supplicant's per-interface control socket. NetworkManager creates supplicant
interfaces over D-Bus passing only Driver and Ifname, so an interface it
re-creates gets an empty config with no ctrl_interface and no socket. Any wifi
toggle (SetInterfaceState, nmcli radio wifi off/on, rfkill) therefore leaves
wpa_cli broken for the life of the wpa_supplicant process.

The probe then reported "not connected" while wifi was up. That logged a false
TELEMETRY_WIFI_NOT_CONNECTED and, worse, left both IsEthernetConnected and
IsWifiConnected at 0 so neither branch of the main flow ran: no gateway
packet-loss telemetry and no wifi recovery ladder until the next maintenance
reboot.

Take wifi state from the kernel instead, so the probe cannot be broken by the
subsystem it is watching:

- checkWifiConnected() uses "iw dev <if> link" (nl80211), which needs no control
  socket, no daemon and no config prerequisite. The LNF SSIDs are hidden, so the
  SSID used for the LNF match comes from "iw dev <if> info" (kernel station
  state), falling back to the SSID: line of "iw link".
- Drop the /tmp/wifi-on gate, a second piece of derived state that can drift and
  produce the same symptom. The file and its other producers and consumers are
  unchanged.
- wifiReassociate() calls fi.w1.wpa_supplicant1.Interface.Reassociate over D-Bus
  instead of "wpa_cli reassociate". Both are wpas_request_connection() behind the
  same WPA_INTERFACE_DISABLED guard, so the operation is identical, but D-Bus
  does not depend on the control socket. The wpa_cli form is kept as a comment
  because it remains the short hand-run equivalent for triage.
- Log whether the reassociate was actually performed. IsWifiReassociated stays
  unconditional: it is the escalation rung counter, and gating it on success
  would stop the ladder ever reaching wifiReset.

Telemetry markers and every t2CountNotify call are byte-identical, and
escalation timing is unchanged. Verified on an 8.6 build, including LNF
detection on a device connected to the LNF enterprise SSID.
@tukken-comcast
tukken-comcast requested a review from a team as a code owner October 16, 2026 14:06
Copilot AI balanced review requested due to automatic review settings October 16, 2026 14:06

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟢 Approval recommended

No blocking issues were identified in the focused changes or their recovery-flow integration.

0 open findings

What changed in this PR

Fixes false Wi-Fi disconnection reports and stalled recovery after Wi-Fi toggles by removing reliance on the supplicant control socket.

Changes:

  • Uses kernel Wi-Fi state and removes the /tmp/wifi-on gate.
  • Reassociates over D-Bus and logs outcomes while preserving recovery escalation and telemetry markers.
File Description
lib/​rdk/​networkConnectionRecovery.sh Updates Wi-Fi detection and reassociation to remain functional after toggles.

🧠 Review effort: Balanced


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@nhanasi
nhanasi merged commit d3a349e into support/5.1.0_release Oct 22, 2026
5 checks passed
@github-actions github-actions Bot locked and limited conversation to collaborators Oct 22, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants