Skip to content

DNS resolver: fix incorrect management of state.#79

Merged
davidchisnall merged 1 commit intoCHERIoT-Platform:mainfrom
rmn30:rmn30/dns_state
Feb 3, 2026
Merged

DNS resolver: fix incorrect management of state.#79
davidchisnall merged 1 commit intoCHERIoT-Platform:mainfrom
rmn30:rmn30/dns_state

Conversation

@rmn30
Copy link
Contributor

@rmn30 rmn30 commented Jan 29, 2026

  1. the state needs to be reset to ready after failures and we need to notify waiters.
  2. incorrect use of futex.wait in loop on entry to network_host_resolve: we need to wait on the previous value changing, not the value we want.

I'm still not totally confident about this.


SystickReturn timestampAfter = thread_systemtick_get();
// Timeouts should not overflow a 32 bit value
timeout->elapse(timestampAfter.lo - timestampBefore.lo);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think this double counts the time spent in state.wait above. Is it really necessary to manually elapse the timeout here?

1) the state needs to be reset to ready after failures.
2) incorrect use of futex.wait in loop on entry to network_host_resolve: we need to wait on the previous value changing, not the value we want.
3) make sure to notify on changes to state (err on side of caution).
@davidchisnall davidchisnall merged commit a7314f9 into CHERIoT-Platform:main Feb 3, 2026
13 of 16 checks passed
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