From 547fde475978b44c16d01deb5614958967883741 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Thu, 11 Apr 2019 11:00:22 +0200 Subject: [PATCH] nss-resolve: simplify condition Of course, if the error is NXDOMAIN then it's not one of the errors listed for fallback, hence don't bother... --- src/nss-resolve/nss-resolve.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/nss-resolve/nss-resolve.c b/src/nss-resolve/nss-resolve.c index 3cfc20851d..113b0b1ee3 100644 --- a/src/nss-resolve/nss-resolve.c +++ b/src/nss-resolve/nss-resolve.c @@ -161,8 +161,7 @@ enum nss_status _nss_resolve_gethostbyname4_r( r = sd_bus_call(bus, req, SD_RESOLVED_QUERY_TIMEOUT_USEC, &error, &reply); if (r < 0) { - if (sd_bus_error_has_name(&error, _BUS_ERROR_DNS "NXDOMAIN") || - !bus_error_shall_fallback(&error)) + if (!bus_error_shall_fallback(&error)) goto not_found; /* Return NSS_STATUS_UNAVAIL when communication with systemd-resolved fails, @@ -342,8 +341,7 @@ enum nss_status _nss_resolve_gethostbyname3_r( r = sd_bus_call(bus, req, SD_RESOLVED_QUERY_TIMEOUT_USEC, &error, &reply); if (r < 0) { - if (sd_bus_error_has_name(&error, _BUS_ERROR_DNS "NXDOMAIN") || - !bus_error_shall_fallback(&error)) + if (!bus_error_shall_fallback(&error)) goto not_found; goto fail; @@ -543,8 +541,7 @@ enum nss_status _nss_resolve_gethostbyaddr2_r( r = sd_bus_call(bus, req, SD_RESOLVED_QUERY_TIMEOUT_USEC, &error, &reply); if (r < 0) { - if (sd_bus_error_has_name(&error, _BUS_ERROR_DNS "NXDOMAIN") || - !bus_error_shall_fallback(&error)) + if (!bus_error_shall_fallback(&error)) goto not_found; goto fail;