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

Issue 219: Should fail if <port> isn't available on IPv4 #220

Merged
merged 2 commits into from
Oct 15, 2016

Conversation

justincmoy
Copy link
Contributor

@justincmoy justincmoy commented Oct 14, 2016

Fix for #219: Should fail if isn't available on IPv4

Copy link
Owner

@grobian grobian left a comment

Choose a reason for hiding this comment

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

Could you fix the spacing issues (use tabs) please?

@justincmoy
Copy link
Contributor Author

I have fixed the spacing issues to use tabs and per the comment on #219, removed the -A flag in order to require all ports to be bound.

@justincmoy justincmoy changed the title Issue 219: Should fail if <port> isn't available on IPv4 with flag -A Issue 219: Should fail if <port> isn't available on IPv4 Oct 15, 2016
@@ -96,6 +97,11 @@ bindlisten(
}

if (bind(sock, resw->ai_addr, resw->ai_addrlen) < 0) {
logout("failed to bind on %s%d port %s\n",
Copy link
Owner

Choose a reason for hiding this comment

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

I would move the saddr block before this if-branch, such that you can use saddr in the error message. Should the OS for some reason return multiple addresses (other than the ALL interface) it is at least reported, but also adds consistency with the OK message lateron.

@grobian grobian merged commit d5563d4 into grobian:master Oct 15, 2016
grobian added a commit that referenced this pull request Oct 15, 2016
Cleanup before when bind() fails, and also cleanup and return when
listen() fails.
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