diff options
author | Lennart Poettering <lennart@poettering.net> | 2019-04-11 11:00:22 +0200 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2019-04-11 11:13:11 +0200 |
commit | 547fde475978b44c16d01deb5614958967883741 (patch) | |
tree | 4c1db291a71d37cc753b46f69dd442b05d0f397d | |
parent | nss-mymachines: return NO_RECOVERY instead of NO_DATA when we fail to do D-Bu... (diff) | |
download | systemd-547fde475978b44c16d01deb5614958967883741.tar.xz systemd-547fde475978b44c16d01deb5614958967883741.zip |
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...
-rw-r--r-- | src/nss-resolve/nss-resolve.c | 9 |
1 files 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; |