Preserve the observe request's local address for notifications - #2146
Merged
Conversation
michieldwitte
force-pushed
the
develop
branch
from
September 7, 2026 11:31
697d702 to
a82dd66
Compare
mrdeep1
reviewed
Sep 7, 2026
mrdeep1
left a comment
Collaborator
There was a problem hiding this comment.
Thanks for doing this work.
Only a generic comment to code ordering.
Comment on lines
+77
to
+79
| coap_add_resource(ctx, resource); | ||
| coap_resource_set_get_observable(resource, 1); | ||
| coap_register_request_handler(resource, COAP_REQUEST_GET, observe_address_handler); |
Collaborator
There was a problem hiding this comment.
As a general comment, coap_add_resource() should be the last thing called when setting up a resource, as a multi-threaded server could start acting on the partially set up resource on another thread.
Packets from the same peer can overwrite a session's local address with a multicast destination. Save the address when an observation is created or renewed and restore it before generating notifications, so deferred responses snapshot the correct address instead of being dropped as invalid multicast. Add regression coverage for CON and NON observations, including renewals and the local address captured by a notification's async response. Validation: 215 unit tests passed (1712 assertions).
michieldwitte
force-pushed
the
develop
branch
from
September 7, 2026 14:30
a82dd66 to
27b4e4a
Compare
Collaborator
|
LGTM |
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.
Packets from the same peer can overwrite a session's local address with a multicast destination. Save the address when an observation is created or renewed and restore it before generating notifications, so deferred responses snapshot the correct address instead of being dropped as invalid multicast.
Add regression coverage for CON and NON observations, including renewals and the local address captured by a notification's async response.
Validation: 215 unit tests passed (1712 assertions).