Commit d6e94866 authored by Per Cederqvist's avatar Per Cederqvist
Browse files

(isc_getipnum): Fixed compilation errors for IPv6 configurations,

	which were introduced in the previous commit.
(isc_gethostname): Ditto.
(isc_getportnum): Ditto.
parent 56cd68a4
......@@ -172,7 +172,7 @@ char *isc_getipnum(union isc_address *ia, char *buf, int len)
}
#ifdef HAVE_INET_NTOP
CHOOSE_IP4OR6(ia->ip.saddr,
CHOOSE_IP4OR6(ia->saddr,
inet_ntop(ia->saddr.sa.sa_family,
(const void *) &ia->saddr.sa_in.sin_addr,
buf,
......@@ -183,17 +183,17 @@ char *isc_getipnum(union isc_address *ia, char *buf, int len)
&ia->saddr.sa_in6.sin6_addr.s6_addr[12],
buf,
len)
: inet_ntop(ia->ip.saddr.sa.sa_family,
: inet_ntop(ia->saddr.sa.sa_family,
(const void *) &ia->saddr.sa_in6.sin6_addr,
buf,
len));
#else
strncpy(buf,
CHOOSE_IP4OR6(ia->ip.saddr,
inet_ntoa(ia->ip.saddr.sa_in.sin_addr),
IN6_IS_ADDR_V4MAPPED(&ia->ip.saddr.sa_in6.sin6_addr)
CHOOSE_IP4OR6(ia->saddr,
inet_ntoa(ia->saddr.sa_in.sin_addr),
IN6_IS_ADDR_V4MAPPED(&ia->saddr.sa_in6.sin6_addr)
? inet_ntoa((struct in_addr *)
&ia->ip.saddr.sa_in6.sin6_addr.s6_addr[12])
&ia->saddr.sa_in6.sin6_addr.s6_addr[12])
: ""),
len-1);
#endif
......@@ -220,7 +220,7 @@ char *isc_gethostname(union isc_address *ia, char *buf, int len)
len = sizeof(hostname)-1;
}
hp = CHOOSE_IP4OR6(ia->ip.saddr,
hp = CHOOSE_IP4OR6(ia->saddr,
gethostbyaddr((char *) &ia->saddr.sa_in.sin_addr,
sizeof(ia->saddr.sa_in.sin_addr),
ia->saddr.sa.sa_family),
......@@ -241,7 +241,7 @@ char *isc_gethostname(union isc_address *ia, char *buf, int len)
int isc_getportnum(union isc_address *ia)
{
return CHOOSE_IP4OR6(ia->ip.saddr,
return CHOOSE_IP4OR6(ia->saddr,
ntohs(ia->saddr.sa_in.sin_port),
ntohs(ia->saddr.sa_in6.sin6_port));
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment