Skip to content

Fix a bug with UDP implicit bind after sendto()#3545

Merged
stevenengler merged 2 commits intoshadow:mainfrom
stevenengler:fix-udp-sendto-implicit-bind
Mar 31, 2025
Merged

Fix a bug with UDP implicit bind after sendto()#3545
stevenengler merged 2 commits intoshadow:mainfrom
stevenengler:fix-udp-sendto-implicit-bind

Conversation

@stevenengler
Copy link
Contributor

Previously a UDP socket that called sendto() would be implicitly bound to an address on the same interface. So sending to 127.0.0.1 would cause the socket to be bound to 127.0.0.1. Sending to 1.2.3.4 would cause the socket to be bound to the public IP address of the host.

This PR fixes the behaviour so that regardless of the address used with sendto(), the socket will always be bound to 0.0.0.0.

This, along with #3531, should fix #3526.

This test is currently failing in Shadow.
@stevenengler stevenengler self-assigned this Mar 31, 2025
@github-actions github-actions bot added Component: Testing Unit and integration tests and frameworks Component: Main Composing the core Shadow executable labels Mar 31, 2025
@stevenengler stevenengler requested a review from a team March 31, 2025 02:47
This causes the test added in the previous commit to pass under Shadow.
@stevenengler stevenengler force-pushed the fix-udp-sendto-implicit-bind branch from 357fb0f to bd1a0ca Compare March 31, 2025 03:25
@github-actions github-actions bot added the Component: Documentation In-repository documentation, under docs/ label Mar 31, 2025
@stevenengler stevenengler merged commit 27d0bcf into shadow:main Mar 31, 2025
25 checks passed
@stevenengler stevenengler deleted the fix-udp-sendto-implicit-bind branch March 31, 2025 15:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Component: Documentation In-repository documentation, under docs/ Component: Main Composing the core Shadow executable Component: Testing Unit and integration tests and frameworks

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Shadow panics when sending a packet in CI test

2 participants