Lines 51-68
Link Here
|
51 |
{ |
51 |
{ |
52 |
bool resv6 = true; |
52 |
bool resv6 = true; |
53 |
struct hostent *h; |
53 |
struct hostent *h; |
54 |
|
54 |
#ifdef RES_USE_INET6 |
|
|
55 |
|
55 |
if (family == AF_INET6) |
56 |
if (family == AF_INET6) |
56 |
{ |
57 |
{ |
57 |
/* From RFC2133, section 6.1 */ |
58 |
/* From RFC2133, section 6.1 */ |
58 |
resv6 = bitset(RES_USE_INET6, _res.options); |
59 |
resv6 = bitset(RES_USE_INET6, _res.options); |
59 |
_res.options |= RES_USE_INET6; |
60 |
_res.options |= RES_USE_INET6; |
60 |
} |
61 |
} |
|
|
62 |
#endif |
61 |
SM_SET_H_ERRNO(0); |
63 |
SM_SET_H_ERRNO(0); |
62 |
h = gethostbyname(name); |
64 |
h = gethostbyname(name); |
|
|
65 |
#ifdef RES_USE_INET6 |
63 |
if (family == AF_INET6 && !resv6) |
66 |
if (family == AF_INET6 && !resv6) |
64 |
_res.options &= ~RES_USE_INET6; |
67 |
_res.options &= ~RES_USE_INET6; |
65 |
|
68 |
|
|
|
69 |
#endif |
66 |
/* the function is supposed to return only the requested family */ |
70 |
/* the function is supposed to return only the requested family */ |
67 |
if (h != NULL && h->h_addrtype != family) |
71 |
if (h != NULL && h->h_addrtype != family) |
68 |
{ |
72 |
{ |