[zeromq-dev] AI_NUMERICSERV reason
hamster
YIDIEPXGXGPN at spammotel.com
Mon Jul 26 15:20:10 CEST 2010
Martin Lucina <mato <at> kotelna.sk> writes:
> > > Could someone elaborate on using AI_NUMERICSERV option for getaddrinfo() in
> > > ip.cpp? There is a comment saying "Avoid named services due to unclear
socktype"
> > > but it does not clear things...
> >
> The comment is a bit misleading. I didn't write the original code, but the
> idea is that requesting a named service, e.g. "telnet" can return either a
> TCP or UDP socket based on the service definition. Plus, it will also
> invoke NSS/NIS to resolve the service name to a numeric port + socket type.
>
> In our case the point is kind of moot since 0MQ explicitly uses only
> numeric port numbers so we don't want to allow named services anyway.
>
I thing there is no way to get UDP socket having passing req.ai_socktype =
SOCK_STREAM to getaddrinfo in that case. As for the NSS/NIS usage - why do not
let end user to decide whether to use them in runtime rather than hardcode such
restrictions?
More information about the zeromq-dev
mailing list