/* Resolve abstract address object to a name using getnameinfo().  */
int nl_addr_resolve(struct nl_addr *addr, char *host, size_t hostlen)
/* Resolve abstract address object to a name using getnameinfo().  */
int nl_addr_resolve(struct nl_addr *addr, char *host, size_t hostlen)
{
	int err;
	struct sockaddr_in6 buf;
	socklen_t salen = sizeof(buf);
	err = nl_addr_fill_sockaddr(addr, (struct sockaddr *) &buf, &salen);
	if (err < 0)
		return err;
	err = getnameinfo((struct sockaddr *) &buf, salen, host, hostlen,
			  NULL, 0, NI_NAMEREQD);
	if (err < 0)
		return nl_syserr2nlerr(err);
	return 0;
}