Hi Mark,
Mark Lumsden wrote on Thu, Sep 23, 2010 at 07:38:00AM +0000:
[...]
No, not ok; i think the patch is incorrect.
The pflag is passed to getaddrinfo(3):
int
getaddrinfo(const char *hostname, const char *servname, const struct
addrinfo *hints, struct addrinfo **res);
The servname is either a decimal port number or a service name
listed in services(5).
Thus, no input validation is desirable.
In fact, nc(1) already provides a (well, moderately) useful error
message when you provide a service not listed in services(5):
schwarze@rhea $ nc -p murks localhost 30000
nc: getaddrinfo: service not supported for ai_socktype
Yours,
Ingo