MCPcopy Create free account
hub / github.com/F-Stack/f-stack / lookup_host6

Function lookup_host6

tools/ipfw/ipv6.c:308–321  ·  view source on GitHub ↗

Try to find ipv6 address by hostname */

Source from the content-addressed store, hash-verified

306
307/* Try to find ipv6 address by hostname */
308static int
309lookup_host6 (char *host, struct in6_addr *ip6addr)
310{
311 struct hostent *he;
312
313 if (!inet_pton(AF_INET6_LINUX, host, ip6addr)) {
314#ifndef FSTACK
315 if ((he = gethostbyname2(host, AF_INET6)) == NULL)
316#endif
317 return(-1);
318 memcpy(ip6addr, he->h_addr_list[0], sizeof( struct in6_addr));
319 }
320 return (0);
321}
322
323
324/*

Callers 1

fill_ip6Function · 0.85

Calls 2

inet_ptonFunction · 0.85
memcpyFunction · 0.50

Tested by

no test coverage detected