[syslinux] tftpd: don't use AI_ADDRCONFIG to resolve addresses to bind(2)

Uwe Kleine-König uwe at kleine-koenig.org
Tue Feb 14 12:32:43 PST 2017


Hello hpa,

On 02/14/2017 08:17 PM, H. Peter Anvin wrote:
> Okay, let me chime in here.

That's great, thanks.

> AI_ADDRCONFIG seems to be the Wrong Thing[TM].
> AI_PASSIVE seems to be the Right Thing[TM].

And you even seem to agree with me, that's still greater :-)

> Part of the problem is that the fallback code for the case of
> getaddrinfo() not being there is braindead, and of course the original
> code used to use gethostbyname() directly.  I already have a much better
> fallback version of getaddrinfo() written which would let us make much
> better use of the getaddrinfo() interface,

Do you still care about platforms without getaddrinfo? This is even in
POSIX.1-2001.

The really right thing to do would be not use a single socket for ipv4
and another for ipv6, but just iterate over the result of getaddrinfo
and open a socket for each addrinfo. But let's not do more than one
thing at a time.

> Now, what I want to know is why you are specifying the accept-all
> address explicitly as 0.0.0.0 instead of an empty string.

That's because that's the default of the Debian tftpd-hpa package. If
you repeat your question about the Debian default, there (I think) the
answer is: it's a relict that predates ipv6 support. OK, probably
already back then '' would have worked. I can only guess about the
reasons, maybe it conflicted with the maintainer scripts that ask for
the default bind address during installation.

Best regards
Uwe

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: OpenPGP digital signature
URL: <http://www.zytor.com/pipermail/syslinux/attachments/20170214/2464a13e/attachment.sig>


More information about the Syslinux mailing list