-
Notifications
You must be signed in to change notification settings - Fork 2k
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: actually bind implicitly #6021
gnrc_sock: actually bind implicitly #6021
Conversation
@@ -221,11 +221,18 @@ ssize_t sock_udp_send(sock_udp_t *sock, const void *data, size_t len, | |||
if (sock != NULL) { | |||
/* bind sock object implicitly */ | |||
sock->local.port = src_port; | |||
if (remote == NULL) { | |||
sock->local.family = sock->remote.family; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it guaranteed that the remote
member of the sock
struct is always set?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes. The line I just added a minor bugfix above guarantees that either remote != NULL
or sock->remote.family != AF_UNSEC
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Assuming a positive answer to my question: ACK
Piggy-backed a minor logical error (which except for some corner cases shouldn't change anything, since in most cases when |
ACK upholds. |
Just setting the port won't cut it. ;-). This fixes the issue we encountered in #6020