return al->addresses + pos;
}
-/* Return 1 if IP is one of the addresses in AL. */
+/* Return non-zero if AL contains IP, zero otherwise. */
int
-address_list_find (const struct address_list *al, const ip_address *ip)
+address_list_contains (const struct address_list *al, const ip_address *ip)
{
int i;
switch (ip->type)
#endif /* ENABLE_IPV6 */
default:
abort ();
- return 1;
+ return 0;
}
}
return NULL;
al = xnew0 (struct address_list);
- al->addresses = xnew_array (ip_address, cnt);
- al->count = cnt;
- al->refcount = 1;
+ al->addresses = xnew_array (ip_address, cnt);
+ al->count = cnt;
+ al->refcount = 1;
ip = al->addresses;
for (ptr = ai; ptr != NULL; ptr = ptr->ai_next)
struct address_list *
lookup_host (const char *host, int flags)
{
- struct address_list *al = NULL;
+ struct address_list *al;
int silent = flags & LH_SILENT;
int use_cache;
hints.ai_flags |= AI_ADDRCONFIG;
#else
/* On systems without AI_ADDRCONFIG, emulate it by manually
- checking whether the system supports IPv6 sockets and. */
+ checking whether the system supports IPv6 sockets. */
if (!socket_has_inet6 ())
hints.ai_family = AF_INET;
#endif