summaryrefslogtreecommitdiff
path: root/src/resolve/resolved-bus.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2014-07-16 03:28:18 +0200
committerLennart Poettering <lennart@poettering.net>2014-07-16 03:28:18 +0200
commitb9d394ea565fd742bcdd34e8dd61ae07c58a9565 (patch)
tree29ca3c5d2f4fb27ee3bd70106e77db146b9d25e8 /src/resolve/resolved-bus.c
parent9d6db739ce1eaa3eace21801fd606d523b73c8f4 (diff)
resolve: add distinct bus error code for hosts that exist but lack A or AAAA records
Diffstat (limited to 'src/resolve/resolved-bus.c')
-rw-r--r--src/resolve/resolved-bus.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/resolve/resolved-bus.c b/src/resolve/resolved-bus.c
index 4a011efc4d..50eb012f8e 100644
--- a/src/resolve/resolved-bus.c
+++ b/src/resolve/resolved-bus.c
@@ -138,8 +138,10 @@ static void bus_method_resolve_hostname_complete(DnsQuery *q) {
added ++;
}
- if (added <= 0)
- goto parse_fail;
+ if (added <= 0) {
+ r = sd_bus_reply_method_errorf(q->request, BUS_ERROR_NO_SUCH_RR, "Hostname %s does not have RR of this type", q->request_hostname);
+ break;
+ }
r = sd_bus_message_close_container(reply);
if (r < 0)
@@ -315,8 +317,10 @@ static void bus_method_resolve_address_complete(DnsQuery *q) {
added ++;
}
- if (added <= 0)
- goto parse_fail;
+ if (added <= 0) {
+ r = sd_bus_reply_method_errorf(q->request, BUS_ERROR_NO_SUCH_RR, "Address %s does not have RR of this type", ip);
+ break;
+ }
r = sd_bus_message_close_container(reply);
if (r < 0)