summaryrefslogtreecommitdiff
path: root/gweb
diff options
context:
space:
mode:
Diffstat (limited to 'gweb')
-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);