coova / coova-chilli

CoovaChilli is an open-source software access controller for captive portal hotspots.
Other
518 stars 260 forks source link

Replace gethostbyname() by getnameinfo() #104

Open gbaligh opened 9 years ago

gbaligh commented 9 years ago

./.libs/libchilli.so: warning: gethostbyname is obsolescent, use getnameinfo() instead.

sevan commented 9 years ago

What OS are you compiling on?

gbaligh commented 9 years ago

I'm using an OpenWRT Linux, compiled to a MIPS target.

gbaligh commented 8 years ago

gethostbyname() does a name→IP lookup. It should be replaced with getaddrinfo(), which can do the same.

This means the warning is completely wrong. getnameinfo() is the replacement of gethostbyaddr(), both for IP→name lookups. The reverse.

name→IP: gethostbyname(), getaddrinfo() IP→name: gethostbyaddr(), getnameinfo()