Score:0

getaddrinfo() return both ipv4 and ipv6 while local system has ipv4 only

id flag

I use getaddrinfo() to get list ip address from a domain which support both ipv4 and ipv6, but the local system support ipv4 only and I want to query ipv4 only. Any one have solution?

there is my config:

struct addrinfo hint, *res = NULL, *p = NULL;
int err;
ACE_OS::memset(&hint, 0, sizeof hint);
hint.ai_family = AF_UNSPEC;
hint.ai_socktype = SOCK_STREAM;
err = ACE_OS::getaddrinfo(hostname.c_str() ,"http", &hint, &res);
kanehekili avatar
zw flag
Well, this forum supports OS questions, you should rather ask this in either the SO or Unix&Linux forum - more people could help you
Thomas Aichinger avatar
cn flag
Did you disable ipv6? Show us the output of ifconfig.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.