(add_hostent): adapt to const hostent_find_fqdn
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@10309 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
@@ -227,22 +227,23 @@ add_hostent (int port, int protocol, int socktype,
|
|||||||
|
|
||||||
if (*flags & AI_CANONNAME) {
|
if (*flags & AI_CANONNAME) {
|
||||||
struct hostent *he2 = NULL;
|
struct hostent *he2 = NULL;
|
||||||
|
const char *tmp_canon;
|
||||||
|
|
||||||
canonname = hostent_find_fqdn (he);
|
tmp_canon = hostent_find_fqdn (he);
|
||||||
if (strchr (canonname, '.') == NULL) {
|
if (strchr (tmp_canon, '.') == NULL) {
|
||||||
int error;
|
int error;
|
||||||
|
|
||||||
he2 = getipnodebyaddr (he->h_addr_list[0], he->h_length,
|
he2 = getipnodebyaddr (he->h_addr_list[0], he->h_length,
|
||||||
he->h_addrtype, &error);
|
he->h_addrtype, &error);
|
||||||
if (he2 != NULL) {
|
if (he2 != NULL) {
|
||||||
char *tmp = hostent_find_fqdn (he2);
|
const char *tmp = hostent_find_fqdn (he2);
|
||||||
|
|
||||||
if (strchr (tmp, '.') != NULL)
|
if (strchr (tmp, '.') != NULL)
|
||||||
canonname = tmp;
|
tmp_canon = tmp;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
canonname = strdup (canonname);
|
canonname = strdup (tmp_canon);
|
||||||
if (he2 != NULL)
|
if (he2 != NULL)
|
||||||
freehostent (he2);
|
freehostent (he2);
|
||||||
if (canonname == NULL)
|
if (canonname == NULL)
|
||||||
|
Reference in New Issue
Block a user