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

Short-circuit interface binding on error #222

Merged
merged 2 commits into from
Oct 18, 2016
Merged

Conversation

metrictwo
Copy link

@metrictwo metrictwo commented Oct 17, 2016

Further fix for #219. The logic in receptor.c causes interfaces to continue being processed after failure to create/bind a socket, as it only breaks out of the address loop. It also treats socket creation failures as non-terminal (not a likely error, but might as well be thorough). The ensures that any error in socket creation/binding stops the process.

@grobian
Copy link
Owner

grobian commented Oct 18, 2016

Oh I see, dumb dumb the addr loop is in there, so it doesn't really exit the function, which was supposed to happen.

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.

Thanks for your PR, if you got time to fix the small remark, please do, else I'll merge and do this myself tomorrow.

@@ -55,7 +55,7 @@ bindlisten(
struct addrinfo *res, *resw;
char buf[128];
char saddr[INET6_ADDRSTRLEN];
int err;
int err, binderr = 0;
Copy link
Owner

Choose a reason for hiding this comment

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

Nitpicking, but could you put this one on a line by itself? Also I usually use a char for these.

Copy link
Author

@metrictwo metrictwo Oct 18, 2016

Choose a reason for hiding this comment

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

Sure, not a problem. Just pushed it up.

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.

thanks

@grobian grobian merged commit ad6ea17 into grobian:master Oct 18, 2016
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