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

fix: socklen_t initialization #59

Merged
merged 2 commits into from
Dec 23, 2024

Conversation

samuelemusiani
Copy link
Contributor

I've noticed that sometimes, when you try to connect to a wirefilter cable with vdeterm, the connection hangs. The bug was that on wirefilter the len parameter on accept was not initialized. As the man page says:

The addrlen argument is a value-result argument: the caller must initialize it to contain the size (in bytes) of the structure pointed to by addr; on return it will contain the actual size of the peer address.

This fix the wirefilter bug. I've also found that this bug was present on vde_router and vde_autolink, so i fix those too.

@rd235
Copy link
Member

rd235 commented Dec 23, 2024

Thank you.

Given that the variable "addr" has not been used, I think it is simpler and safer to delete the addr and len variables and change the accept statement to
new = accept(fd, &addr, &len);

(this comment applies to the three identical changes).

Copy link
Member

@rd235 rd235 left a comment

Choose a reason for hiding this comment

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

Thank you for fixing this "ancient" bug....

@rd235 rd235 merged commit 85eb7a6 into virtualsquare:master Dec 23, 2024
2 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