halow: fail mmhalow_init() when the transceiver won't boot - #6
Open
ericrwx wants to merge 1 commit into
Open
Conversation
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
force-pushed
the
fix-init-fail-on-boot-timeout
branch
from
July 30, 2026 01:28
177bf8a to
4ebcf54
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.