summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGrant Erickson <marathon96@gmail.com>2012-07-16 09:48:09 -0700
committerDaniel Wagner <daniel.wagner@bmw-carit.de>2012-07-17 10:14:45 +0200
commit42e3cd5263c245ae4f9e454160a35b2267475183 (patch)
tree908bdde3ceaa421a7772c2f770b5fa6517fd5092
parent043da7360b1036dbcdb995e3b3b9a77da6c31cd5 (diff)
downloadconnman-42e3cd5263c245ae4f9e454160a35b2267475183.tar.gz
connman-42e3cd5263c245ae4f9e454160a35b2267475183.tar.bz2
connman-42e3cd5263c245ae4f9e454160a35b2267475183.zip
gresolv: Do not update successful status with unsuccessful one
When performing a resolver lookup from timeserver or wpad, both perform queries with an unspecified address family. This means that both A and AAAA record queries are issued. In cases where a valid, successful A response comes back but where the AAAA query results in a timeout, do not smash the successful A status with the time out AAAA status; otherwise, the timeserver or wpad will appear to fail to them when, in fact, the A query was successful and more than satisfies its unspecified address family requirement. Partial fix for BMC#25486.
-rw-r--r--gweb/gresolv.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/gweb/gresolv.c b/gweb/gresolv.c
index caa30eeb..d96f345b 100644
--- a/gweb/gresolv.c
+++ b/gweb/gresolv.c
@@ -486,10 +486,16 @@ static void sort_and_return_results(struct resolv_lookup *lookup)
results[n++] = NULL;
- status = lookup->ipv4_status;
-
- if (status == G_RESOLV_RESULT_STATUS_SUCCESS)
+ if (lookup->resolv->result_family == AF_INET)
+ status = lookup->ipv4_status;
+ else if (lookup->resolv->result_family == AF_INET6)
status = lookup->ipv6_status;
+ else {
+ if (lookup->ipv6_status == G_RESOLV_RESULT_STATUS_SUCCESS)
+ status = lookup->ipv6_status;
+ else
+ status = lookup->ipv4_status;
+ }
lookup->result_func(status, results, lookup->result_data);