/* Allocate new abstract address object based on a binary address.  */
struct nl_addr* nl_addr_build(int family, void *buf, size_t size)
/* Allocate new abstract address object based on a binary address.  */
struct nl_addr* nl_addr_build(int family, void *buf, size_t size)
{
	struct nl_addr *addr;
	addr = nl_addr_alloc(size);
	if (!addr)
		return NULL;
	addr->a_family = family;
	addr->a_len = size;
	addr->a_prefixlen = size*8;
	if (size)
		memcpy(addr->a_addr, buf, size);
	return addr;
}