This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: 1.7.0: getnameinfo bug


On Aug  6 20:48, Zhiming Zhou wrote:
> This bug happens on every 1.7.0 beta version.
> I use getnameinfo function with NI_NUMERICHOST flag,
> 
> if the "sin_port" of sockaddr is a known port(like 21, 80...)
> in "/etc/services" file, getnameinfo function works ok, and
> service name is correctly fetched(ftp, http...).
> 
> however if I fill "sin_port" with an unknown port(like 6400, 6499)
> getnameinfo returns EAI_NODATA, and if i add a 6400 or 6499 service
> entry in "/etc/services" file, getnameinfo works ok again.
> 
> So, I move the code to Linux, it works ok either "sin_port" is known
> or unknown, if port is known(like 21), service name is fetched(ftp),
> if not(6400), service name is filled with port number(6400), and it
> works very good :)
> 
> Any helps?

On what OS are you running?  If that's Windows XP or 2003, then that's
a known shortcoming of the OS which is fixed in Windows Vista and later.
The workaround is to specify NI_NUMERICSERV.

I'll take a stab at fixing this in Cygwin for XP/2003 so that it behaves
as on Vista.


Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Project Co-Leader          cygwin AT cygwin DOT com
Red Hat

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]