Skip to content

halow: fail mmhalow_init() when the transceiver won't boot - #6

Open
ericrwx wants to merge 1 commit into
MorseMicro:mainfrom
ericrwx:fix-init-fail-on-boot-timeout
Open

halow: fail mmhalow_init() when the transceiver won't boot#6
ericrwx wants to merge 1 commit into
MorseMicro:mainfrom
ericrwx:fix-init-fail-on-boot-timeout

Conversation

@ericrwx

@ericrwx ericrwx commented Jul 28, 2026

Copy link
Copy Markdown

mmhalow_init() discarded mmwlan_boot()'s status with an explicit (void) cast, then created and started the netif and returned ESP_OK regardless. A caller was told it had a working HaLow interface when the transceiver had never booted, and the first symptom surfaced much later as unexplained traffic loss on an interface that looked healthy.

Any transport-level boot failure reaches this path, and it is not quiet: mmdrv_init() has already logged "Transport init failed" by the time mmhalow_init() returns success, so the log and the return value disagree.

Keep the boot status, log it, and return ESP_FAIL instead of creating a netif that cannot carry traffic.

Note this is a behaviour change for callers that ignore the return value: mmhalow_init() can now fail where it previously always returned ESP_OK. Callers that already check it need no change.

Comment thread halow/mmhalow.c Outdated
mmhalow_init() discarded mmwlan_boot()'s status with an explicit (void)
cast, then created and started the netif and returned ESP_OK regardless.
A caller was told it had a working HaLow interface when the transceiver
had never booted, and the first symptom surfaced much later as unexplained
traffic loss on an interface that looked healthy.

Any transport-level boot failure reaches this path, and it is not quiet:
mmdrv_init() has already logged "Transport init failed" by the time
mmhalow_init() returns success, so the log and the return value disagree.

Keep the boot status, log it, and return ESP_FAIL instead of creating a
netif that cannot carry traffic.

Note this is a behaviour change for callers that ignore the return value:
mmhalow_init() can now fail where it previously always returned ESP_OK.
Callers that already check it need no change.

Signed-off-by: Eric Wang <eric@rwx.one>
@ericrwx
ericrwx force-pushed the fix-init-fail-on-boot-timeout branch from 177bf8a to 4ebcf54 Compare July 30, 2026 01:28
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.

2 participants