[reSIProcate] DnsUtil::getLocalHostName resolves 2x the hostname
Bayart, Frederik
Frederik.Bayart at siemens.com
Wed Feb 8 02:31:50 CST 2006
Hi Scott,
Thank you for the answer. You are right. I didn't test it enough. Below you can find some more feedback about a fix on solaris.
Regards,
Frederik
I'm building the tar ball 0.9.0 on solaris 8 with gnu compiler 3.4.2.
At the top of DnsUtil.cxx, there is the following include construction
#if !defined(WIN32) && !defined (__sun__)
...
#include <netdb.h>
#endif
I saw that this is also the case in the main branch in CVS. On solaris, at least on my workstation, gethostbyname is defined in netdb.h, so I had to move the include outside the if statement :
#if !defined(WIN32) && !defined (__sun__)
...
#endif
#include <netdb.h>
Also, gethostbyname is implemented on solaris in libnsl, which is not put in de LIBS variable if you simply execute configure. I had to execute :
configure LIBS="-lnsl"¹
-----Original Message-----
From: resiprocate-devel-bounces at list.sipfoundry.org
[mailto:resiprocate-devel-bounces at list.sipfoundry.org]On Behalf Of Scott
Godin
Sent: Tuesday, February 07, 2006 2:58 PM
To: Bayart, Frederik; resiprocate-devel at list.sipfoundry.org
Subject: RE: [reSIProcate] DnsUtil::getLocalHostName resolves 2x the
hostname
Bryan,
I already responded to your original posting, but here it is again....
These two functions perform different tasks. The output from the first
is passed to the 2nd.
The gethostname() function returns the standard host name for the
current machine. I'm pretty sure this hostname does not contain any
domain, ie. just machine name.
The gethostbyname function retrieves host information corresponding to a
host name from a host database. The host information structure contains
the FQDN version of the hostname.
I don't think there are any bugs with this.
Scott
More information about the resiprocate-devel
mailing list