-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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 header includes and build failures on musl #518
Conversation
Thanks for the pull request! I need to try to make some time to look at this. I need to think about the "sort header includes" part...it doesn't seem to be strictly needed and there are some cases (not sure if any of them are applicable to this situation) where the order of header inclusion is actually important, so we don't just want to rearrange them arbitrarily. Thanks for all the other portability fixes though...again I haven't read all of the code but from the description these sounds like a Good Thing (tm). |
Yeah the sort part is just for readability, feel free to remove it if it'd introduce misbehaviour. |
At this point I'm leaning towards fixing the stdint.h stuff and the getsockopt(3) type bug. I don't know how to take part of a pull request, so I think the only way to do this is for someone (you, me, doesn't matter) to make a new commit with just the parts I want. A minimal commit to fix this would only need to touch |
Signed-off-by: Moritz Kick <[email protected]>
getsockopt expects socklen_t instead of int as its fifth argument Signed-off-by: Moritz Kick <[email protected]>
I'll rebase and revert the commits, this should automatically update the PR. Now the remaining problem is that the struct tcp_info and some pieces of struct tcphdr are behind a _GNU_SOURCE guard, which isn't defined anywhere. Multiple solutions for that are possible: |
The plan for revising the pull request sounds great, thanks. We do define (Of the remaining solutions you proposed, I'm not a big fan of c) because that requires us to include |
also cleanup the second include of stdint.h in main.c Signed-off-by: Moritz Kick <[email protected]>
Well yes, everytime
Regarding method c) I added another commit with that change for review, the other changes have already been commited separately. |
Looks good to me and thanks for the explanation (as well as your work on the patch!). Merged. I'm going to mess around with issue statuses to make them reflect reality. This change should get merged to the 3.1-STABLE branch, which I intend to do before the next release. |
* Include stdint.h in files where its types are used Signed-off-by: Moritz Kick <[email protected]> * Fix type of len parameter passed to getsockopt getsockopt expects socklen_t instead of int as its fifth argument Signed-off-by: Moritz Kick <[email protected]> * Remove unnecassary includes of netinet/tcp.h also cleanup the second include of stdint.h in main.c This commit fixes #331 and is a replacement for #344. Signed-off-by: Moritz Kick <[email protected]> (cherry picked from commit a8ee9c6)
Signed-off-by: Moritz Kick [email protected]