]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
nss-resolve: simplify condition
authorLennart Poettering <lennart@poettering.net>
Thu, 11 Apr 2019 09:00:22 +0000 (11:00 +0200)
committerLennart Poettering <lennart@poettering.net>
Thu, 11 Apr 2019 09:13:11 +0000 (11:13 +0200)
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

index 3cfc20851d82dac213fc27c92bf8b388c93ebb7d..113b0b1ee35d099d147dd501534a64a3b4065579 100644 (file)
@@ -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;