bug-inetutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[bug-inetutils] Re: [PATCH] Implement IPv6 capability for the TFTP serve


From: Simon Josefsson
Subject: [bug-inetutils] Re: [PATCH] Implement IPv6 capability for the TFTP server.
Date: Wed, 29 Sep 2010 08:12:49 +0200
User-agent: Gnus/5.110011 (No Gnus v0.11) Emacs/23.2 (gnu/linux)

Mats Erik Andersson <address@hidden> writes:

> tisdag den 28 september 2010 klockan 23:50 skrev Simon Josefsson detta:
>> Mats Erik Andersson <address@hidden> writes:
>> 
>> > My other suggested patching of the TFTP client presently adds
>> >
>> >      NI_MAXSERV
>> >      struct addrinfo
>> >      getaddrinfo(3)
>> >      gai_strerror(3)
>> >      freeaddrinfo(3)
>> >      strrchr(3)
>> >
>> > All these are fulfilled by any decent OS as far as I understand.
>> 
>> And if they aren't, gnulib fixes that for us.
>> 
>> However, why do you need NI_MAXSERV?  I can't find it in POSIX nor in
>> the Glibc manual.  I'm not sure it is portable.
>
> See getnameinfo(3). The constant ought to be present in <netdb.h>
> for every decent OS.

Interesting, it is documented in RFC 2133/2553/4038 and from the man
page it appears to be intended as a GNU-extension, but it is not
mentioned in POSIX or the Glibc manual.  I wonder how portable it is?
An old Solaris host I looked at had it.  Maybe something for the Austin
group...

NOTES
       In  order to assist the programmer in choosing reasonable sizes for the
       supplied buffers, <netdb.h> defines the constants

           #define NI_MAXHOST      1025
           #define NI_MAXSERV      32

       Since glibc 2.8, these definitions are exposed only if one of the  fea‐
       ture test macros _BSD_SOURCE, _SVID_SOURCE, or _GNU_SOURCE is defined.

       The  former  is  the  constant  MAXDNAME  in  recent versions of BIND's
       <arpa/nameser.h> header file.  The latter is a guess based on the  ser‐
       vices listed in the current Assigned Numbers RFC.

/Simon



reply via email to

[Prev in Thread] Current Thread [Next in Thread]