diff options
author | Nadezhda Ivanova <nadezhda.ivanova@postpath.com> | 2010-01-07 12:34:06 +0200 |
---|---|---|
committer | Nadezhda Ivanova <nadezhda.ivanova@postpath.com> | 2010-01-07 12:34:06 +0200 |
commit | 309473f938d18b9993c2c4f120eeff7b4641985a (patch) | |
tree | c07dde840efd38b75a4b196b247c11946c3b57c9 /source4/libcli | |
parent | fb5383c69ee52fb5e6d066a43451dc8c806cc795 (diff) | |
parent | 71a40d7e2c21bf3ac47be3ec57fb091ff420ba9a (diff) | |
download | samba-309473f938d18b9993c2c4f120eeff7b4641985a.tar.gz samba-309473f938d18b9993c2c4f120eeff7b4641985a.tar.bz2 samba-309473f938d18b9993c2c4f120eeff7b4641985a.zip |
Merge branch 'master' of git://git.samba.org/samba
Diffstat (limited to 'source4/libcli')
-rw-r--r-- | source4/libcli/resolve/dns_ex.c | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/source4/libcli/resolve/dns_ex.c b/source4/libcli/resolve/dns_ex.c index 1b5037273a..79ed78340c 100644 --- a/source4/libcli/resolve/dns_ex.c +++ b/source4/libcli/resolve/dns_ex.c @@ -283,14 +283,19 @@ static void run_child_getaddrinfo(struct dns_ex_state *state, int fd) hints.ai_flags = AI_ADDRCONFIG | AI_NUMERICSERV; ret = getaddrinfo(state->name.name, "0", &hints, &res_list); + /* try to fallback in case of error */ + if (state->do_fallback) { + switch (ret) { #ifdef EAI_NODATA - if (ret == EAI_NODATA && state->do_fallback) { -#else - if (ret == EAI_NONAME && state->do_fallback) { + case EAI_NODATA: #endif - /* getaddrinfo() doesn't handle CNAME records */ - run_child_dns_lookup(state, fd); - return; + case EAI_NONAME: + /* getaddrinfo() doesn't handle CNAME records */ + run_child_dns_lookup(state, fd); + return; + default: + break; + } } if (ret != 0) { goto done; |