Hi Collin, > #define NI_MAXHOST 1025 > #define NI_MAXSERV 32 > > That is what glibc does too. I've applied the attached patches to make > sure these are defined correctly.
Thanks. After reading [1] and [2], I agree that's the right thing to do. > Does anyone know why > RFC 2553 has the larger buffer size? I thought per RFC 1034 domain names > were limited to 253 bytes, with the trailing dot removed and empty root > label removed [3]. I think [1] explains it: "The first value is actually defined as the constant MAXDNAME in recent versions of BIND's <arpa/nameser.h> header (older versions of BIND define this constant to be 256)" > +/* Maximumn length of a fully-qualified domain name. */ Typo: s/mumn/mum/ > +#ifndef NI_MAXHOST > +# define NI_MAXHOST 1025 > +#elif NI_MAXHOST != 1025 > +# undef NI_MAXHOST > +# define NI_MAXHOST 1025 > +#endif I think this can be simplified to #if !(defined NI_MAXHOST && NI_MAXHOST == 1025) # undef NI_MAXHOST # define NI_MAXHOST 1025 #endif or even outright to /* Use the value defined by the RFCs, regardless of platform. */ #undef NI_MAXHOST #define NI_MAXHOST 1025 Bruno [1] https://datatracker.ietf.org/doc/html/rfc2553 [2] https://www.openwall.com/lists/musl/2017/04/23/8