From f527c6fa0881aec14e54b2f0ff21ab2964eef481 Mon Sep 17 00:00:00 2001 From: Yu Watanabe Date: Fri, 24 Jul 2020 21:03:25 +0900 Subject: [PATCH] resolvectl: fix older resolved or networkd support to set DNS servers Fixes #16573. --- src/resolve/resolvectl.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/resolve/resolvectl.c b/src/resolve/resolvectl.c index 476c5e4a3c0..3072b984e5d 100644 --- a/src/resolve/resolvectl.c +++ b/src/resolve/resolvectl.c @@ -1969,8 +1969,10 @@ static int call_dns(sd_bus *bus, char **dns, const BusLocator *locator, sd_bus_e return bus_log_create_error(r); r = sd_bus_call(bus, req, 0, error, NULL); - if (r < 0 && extended && sd_bus_error_has_name(error, SD_BUS_ERROR_UNKNOWN_METHOD)) + if (r < 0 && extended && sd_bus_error_has_name(error, SD_BUS_ERROR_UNKNOWN_METHOD)) { + sd_bus_error_free(error); return call_dns(bus, dns, locator, error, false); + } return r; }