getaddrinfo() does not implement IDN encoding, and always fail when provided an IDN flag (e.g., AI_IDN) with EAI_BADFLAGS. Some packages (such as the VLC media player) check for AI_IDN before they use it; providing an unimplemented AI_IDN in the libc makes these package fail. As a result they make calls to getaddrinfo() with AI_IDN that always fail while they could have made successful calls without AI_IDN instead.
Thus, do not define IDN flags: it is better not to compile rather than to compile a code that always fail.
Signed-off-by: Thomas Claveirole thomas.claveirole@green-communications.fr --- include/netdb.h | 11 ----------- 1 file changed, 11 deletions(-)
diff --git a/include/netdb.h b/include/netdb.h index a636b5f..95abe95 100644 --- a/include/netdb.h +++ b/include/netdb.h @@ -627,16 +627,6 @@ struct addrinfo # define AI_ALL 0x0010 /* Return IPv4 mapped and IPv6 addresses. */ # define AI_ADDRCONFIG 0x0020 /* Use configuration of this host to choose returned address type.. */ -# ifdef __USE_GNU -# define AI_IDN 0x0040 /* IDN encode input (assuming it is encoded - in the current locale's character set) - before looking it up. */ -# define AI_CANONIDN 0x0080 /* Translate canonical name from IDN format. */ -# define AI_IDN_ALLOW_UNASSIGNED 0x0100 /* Don't reject unassigned Unicode - code points. */ -# define AI_IDN_USE_STD3_ASCII_RULES 0x0200 /* Validate strings according to - STD3 rules. */ -# endif # define AI_NUMERICSERV 0x0400 /* Don't use name resolution. */
/* Error values for `getaddrinfo' function. */ @@ -658,7 +648,6 @@ struct addrinfo # define EAI_NOTCANCELED -102 /* Request not canceled. */ # define EAI_ALLDONE -103 /* All requests done. */ # define EAI_INTR -104 /* Interrupted by a signal. */ -# define EAI_IDN_ENCODE -105 /* IDN encoding failed. */ # endif
# ifdef __USE_MISC
Hi Thomas, Thomas Claveirole wrote,
getaddrinfo() does not implement IDN encoding, and always fail when provided an IDN flag (e.g., AI_IDN) with EAI_BADFLAGS. Some packages (such as the VLC media player) check for AI_IDN before they use it; providing an unimplemented AI_IDN in the libc makes these package fail. As a result they make calls to getaddrinfo() with AI_IDN that always fail while they could have made successful calls without AI_IDN instead.
Thus, do not define IDN flags: it is better not to compile rather than to compile a code that always fail.
I would rather like to see that IDN gets implemented and via a config symbol disabled by default.
Other apps as systemd also using IDN, as I have seen yesterday :)
Are you willing on implementing or porting an existing implementation to uClibc-ng?
best regards Waldemar
Hi Waldemar,
getaddrinfo() does not implement IDN encoding, and always fail when provided an IDN flag (e.g., AI_IDN) with EAI_BADFLAGS. [...]
Thus, do not define IDN flags: it is better not to compile rather than to compile a code that always fail.
I would rather like to see that IDN gets implemented and via a config symbol disabled by default. [...] Are you willing on implementing or porting an existing implementation to uClibc-ng?
Unfortunately, I do not plan to do that. I am just trying to have VLC work with Buildroot and uClibc-ng, and I do not have much time to spend on this.
Besides, IDN relies on Unicode, and I guess the implementation would be either fairly complex or involve other libraries (ICU, libidn?) This would also be probably big.
Best regards,
On Tue, Feb 2, 2016 at 8:25 AM, Thomas Claveirole thomas.claveirole@green-communications.fr wrote:
Hi Waldemar,
getaddrinfo() does not implement IDN encoding, and always fail when provided an IDN flag (e.g., AI_IDN) with EAI_BADFLAGS. [...]
Those errors look familiar. I had a similar problem with inetutils and uClibc (ping was broken -- ping!), for which I submitted a patch (which was never accepted).
Perhaps you could just patch vlc in a similar way not to use the offending AI_IDN flag?
http://lists.gnu.org/archive/html/bug-inetutils/2015-10/msg00001.html
I haven't tried it at all, mind you, but I think the below (or something like it) will address your problem:
diff --git a/include/vlc_network.h b/include/vlc_network.h index 28a9fa6..39f011b 100644 --- a/include/vlc_network.h +++ b/include/vlc_network.h @@ -193,6 +193,9 @@ VLC_API ssize_t net_vaPrintf( vlc_object_t *p_this, int fd, const char *psz_fmt, #ifndef AI_NUMERICSERV # define AI_NUMERICSERV 0 #endif +#ifndef HAVE_LIBCIDN /* Does not have a usable AI_IDN flag */ +# undef AI_IDN +#endif #ifndef AI_IDN # define AI_IDN 0 /* GNU/libc extension */ #endif
I think trying the above wouldn't take much of your time.
It should also be noted that you can configure glibc without IDN support, too (libcidn), which makes you wind up in the same situation.
Thus, do not define IDN flags: it is better not to compile rather than to compile a code that always fail.
I would rather like to see that IDN gets implemented and via a config symbol disabled by default. [...] Are you willing on implementing or porting an existing implementation to uClibc-ng?
Unfortunately, I do not plan to do that. I am just trying to have VLC work with Buildroot and uClibc-ng, and I do not have much time to spend on this.
Besides, IDN relies on Unicode, and I guess the implementation would be either fairly complex or involve other libraries (ICU, libidn?) This would also be probably big.
Best regards,
Thomas Claveirole thomas.claveirole@green-communications.fr
Cheers, Jaret
getaddrinfo() does not implement IDN encoding, and always fail when provided an IDN flag (e.g., AI_IDN) with EAI_BADFLAGS.
[...] Perhaps you could just patch vlc in a similar way not to use the offending AI_IDN flag?
Thanks for your time. My custom Buildroot repository already features a similar VLC patch that fixes the issue. I just thought this was not a proper fix and I should rather address the problem directly in uClibc-ng, then push the patch to upstream uClibc-ng.
(To me this is a libc issue, not a VLC or inetutils issue.)
Cheers,
Hi Thomas, Thomas Claveirole wrote,
getaddrinfo() does not implement IDN encoding, and always fail when provided an IDN flag (e.g., AI_IDN) with EAI_BADFLAGS.
[...] Perhaps you could just patch vlc in a similar way not to use the offending AI_IDN flag?
Thanks for your time. My custom Buildroot repository already features a similar VLC patch that fixes the issue. I just thought this was not a proper fix and I should rather address the problem directly in uClibc-ng, then push the patch to upstream uClibc-ng.
(To me this is a libc issue, not a VLC or inetutils issue.)
I agree. I underestimated the needed work to get IDN working. I applied and pushed the patch, thx Waldemar