Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gnrc_sock_udp: accept response from any address if remote is multicast #18854

Merged
merged 3 commits into from
Nov 15, 2022

Conversation

benpicco
Copy link
Contributor

@benpicco benpicco commented Nov 7, 2022

Contribution description

sock_udp_create() with a set remote is not just a convenient way to not having to keep the remote around when calling sock_udp_send() it actually binds the socket to that remote and will drop any response from a different address.

This is of course not very practical when the remote is a multicast address as this means all unicast responses are dropped.

This adds a new SOCK_FLAGS_BIND_REMOTE flag that gets set automatically for unicast remotes to retain current behavior.

This also moves the remote-checking code sock_udp_recv_buf_aux() to make it more readable as this was not so straightforward to debug.

Testing procedure

A new test case was added to tests/gnrc_sock_udp.

Issues/PRs references

sys/include/net/sock.h Outdated Show resolved Hide resolved
@github-actions github-actions bot added the Area: tests Area: tests and testing framework label Nov 7, 2022
@benpicco benpicco force-pushed the gnrc_sock_udp-_remote_mismatch branch from b59b116 to e29a6ff Compare November 7, 2022 18:48
@benpicco benpicco added the CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR label Nov 7, 2022
@riot-ci
Copy link

riot-ci commented Nov 7, 2022

Murdock results

✔️ PASSED

920d690 test/gnrc_udp: add test multicast sock

Success Failures Total Runtime
117848 0 117848 01h:39m:24s

Artifacts

This only reflects a subset of all builds from https://ci-prod.riot-os.org. Please refer to https://ci.riot-os.org for a complete build for now.

@benpicco benpicco requested a review from kfessel November 15, 2022 09:46
@benpicco benpicco force-pushed the gnrc_sock_udp-_remote_mismatch branch from 2e7b891 to d064feb Compare November 15, 2022 10:21
Copy link
Contributor

@kfessel kfessel left a comment

Choose a reason for hiding this comment

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

read this looks good, and i trust @benpicco testing

@benpicco benpicco force-pushed the gnrc_sock_udp-_remote_mismatch branch from 64d4de4 to 920d690 Compare November 15, 2022 10:26
@benpicco benpicco merged commit e710b6f into RIOT-OS:master Nov 15, 2022
@benpicco
Copy link
Contributor Author

Thank you for the review!

@benpicco benpicco deleted the gnrc_sock_udp-_remote_mismatch branch November 15, 2022 19:34
@kaspar030 kaspar030 added this to the Release 2023.01 milestone Jan 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: network Area: Networking Area: sys Area: System Area: tests Area: tests and testing framework CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants