-
Notifications
You must be signed in to change notification settings - Fork 257
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
Various portability fixes #7861
Conversation
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.
Hi,
thank you for the fixes, I'm fine with them. Just a comment about the commit messages, afaik "quirk" is written with a "k".
bye,
Sumit
9d16793
to
be167ec
Compare
fixed, thanks! |
@@ -45,6 +45,14 @@ typedef int errno_t; | |||
#define EOK 0 | |||
#endif | |||
|
|||
#ifndef NETDB_INTERNAL | |||
#define NETDB_INTERNAL (-1) |
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.
What does musl use instead?
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.
I'm not sure that there is a equivalent to glibc's NETDB_INTERNAL.
See glibc's implementation (https://github.com/bminor/glibc/blob/596130591ae4b058a529cc1318b95e624559054c/resolv/netdb.h#L63-L75) and musl's (https://github.com/bminor/musl/blob/c47ad25ea3b484e10326f933e927c0bc8cded3da/include/netdb.h#L123-L129). Also POSIX seems not to offfer a equivalent: https://pubs.opengroup.org/onlinepubs/009696799/functions/gethostbyaddr.html
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.
But how will musl work with 'libnss_sss' if it doesn't expect -1 to be returned?
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.
Hmm, do you know where libnss_sss returns NETDB_INTERNAL to musl?
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.
$ grep -rn NETDB_INTERNAL *
nss_hosts.c:233: *h_errnop = NETDB_INTERNAL;
nss_hosts.c:240: *h_errnop = NETDB_INTERNAL;
nss_hosts.c:247: *h_errnop = NETDB_INTERNAL;
nss_hosts.c:282: *h_errnop = NETDB_INTERNAL;
nss_hosts.c:294: *h_errnop = NETDB_INTERNAL;
nss_hosts.c:353: *h_errnop = NETDB_INTERNAL;
nss_hosts.c:360: *h_errnop = NETDB_INTERNAL;
nss_hosts.c:367: *h_errnop = NETDB_INTERNAL;
nss_hosts.c:412: *h_errnop = NETDB_INTERNAL;
nss_hosts.c:424: *h_errnop = NETDB_INTERNAL;
nss_hosts.c:461: *h_errnop = NETDB_INTERNAL;
nss_hosts.c:479: *h_errnop = NETDB_INTERNAL;
nss_ipnetworks.c:204: *h_errnop = NETDB_INTERNAL;
nss_ipnetworks.c:211: *h_errnop = NETDB_INTERNAL;
nss_ipnetworks.c:223: *h_errnop = NETDB_INTERNAL;
nss_ipnetworks.c:246: *h_errnop = NETDB_INTERNAL;
nss_ipnetworks.c:266: *h_errnop = NETDB_INTERNAL;
nss_ipnetworks.c:311: *h_errnop = NETDB_INTERNAL;
nss_ipnetworks.c:318: *h_errnop = NETDB_INTERNAL;
nss_ipnetworks.c:327: *h_errnop = NETDB_INTERNAL;
nss_ipnetworks.c:349: *h_errnop = NETDB_INTERNAL;
nss_ipnetworks.c:372: *h_errnop = NETDB_INTERNAL;
nss_ipnetworks.c:392: *h_errnop = NETDB_INTERNAL;
nss_ipnetworks.c:421: *h_errnop = NETDB_INTERNAL;
nss_ipnetworks.c:444: *h_errnop = NETDB_INTERNAL;
nss_ipnetworks.c:467: *h_errnop = NETDB_INTERNAL;
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.
Not sure why above patch was so contained.
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.
@fossdd, what is your stance on this?
Do you want to dig deeper or are you fine to merely get code to the state "it compiled with musl"?
@sumit-bose, do you think we could extend 1a1e914 to replace all uses of NETDB_INTERNAL
with NO_RECOVERY
/ HOST_NOT_FOUND
(portable)?
@scabrero, do you remember if there was a reason to use NETDB_INTERNAL
specifically?
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.
For me, it's fine. we already ship this code downstream, and afaik this snippet worked fine.
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.
@scabrero, do you remember if there was a reason to use
NETDB_INTERNAL
specifically?
I don't remember if there was a specific reason by that time, but having a look it is probably because it is the way to say "check errno":
# define NETDB_INTERNAL -1 /* See errno. */
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.
For me, it's fine. we already ship this code downstream, and afaik this snippet worked fine.
Ok, if nobody else chimes in in a next day or two, this will be merged "as is".
Remove usage of _PATH_HOSTS, which only exists in glibc
NETDB_INTERNAL is a glibc quirk and doesnt exist in POSIX
be167ec
to
839847c
Compare
See commit messages for further information