mirror of
https://github.com/home-assistant/operating-system.git
synced 2025-07-28 07:26:28 +00:00
* Do not send excessive DNS queries for online checks (#2100)
This commit is contained in:
parent
ed554f2a39
commit
53818a1325
@ -0,0 +1,46 @@
|
|||||||
|
From 88f63699c444e43096e765b2603aa211a8ae58bb Mon Sep 17 00:00:00 2001
|
||||||
|
Message-Id: <88f63699c444e43096e765b2603aa211a8ae58bb.1661980860.git.stefan@agner.ch>
|
||||||
|
From: Thomas Haller <thaller@redhat.com>
|
||||||
|
Date: Fri, 8 Apr 2022 15:33:39 +0200
|
||||||
|
Subject: [PATCH] connectivity: handle "NoNameServers" resolved error and don't
|
||||||
|
callback to system resolver
|
||||||
|
|
||||||
|
No need to try further. The verdict is clear.
|
||||||
|
|
||||||
|
From the log:
|
||||||
|
|
||||||
|
<debug> [1649424031.1507] connectivity: (wlan0,IPv4,427) can't resolve a name via systemd-resolved: GDBus.Error:org.freedesktop.resolve1.NoNameServers: No appropriate name servers or networks for name found
|
||||||
|
<debug> [1649424031.1507] connectivity: (wlan0,IPv4,427) start request to 'http://fedoraproject.org/static/hotspot.txt' (try resolving 'fedoraproject.org' using system resolver)
|
||||||
|
|
||||||
|
(cherry picked from commit 5b779c1ab7fb53857db235383af8274ab824a55e)
|
||||||
|
(altered to apply to 1.34.0)
|
||||||
|
---
|
||||||
|
src/core/nm-connectivity.c | 11 ++++++++++-
|
||||||
|
1 file changed, 10 insertions(+), 1 deletion(-)
|
||||||
|
|
||||||
|
diff --git a/src/core/nm-connectivity.c b/src/core/nm-connectivity.c
|
||||||
|
index 13fb026514..3e4914ee3b 100644
|
||||||
|
--- a/src/core/nm-connectivity.c
|
||||||
|
+++ b/src/core/nm-connectivity.c
|
||||||
|
@@ -719,8 +719,17 @@ resolve_cb(GObject *object, GAsyncResult *res, gpointer user_data)
|
||||||
|
g_clear_object(&cb_data->concheck.resolve_cancellable);
|
||||||
|
|
||||||
|
if (!result) {
|
||||||
|
- /* Never mind. Just let do curl do its own resolving. */
|
||||||
|
+ gs_free char *dbus_error = NULL;
|
||||||
|
+
|
||||||
|
_LOG2D("can't resolve a name via systemd-resolved: %s", error->message);
|
||||||
|
+
|
||||||
|
+ dbus_error = g_dbus_error_get_remote_error(error);
|
||||||
|
+ if (nm_streq0(dbus_error, "org.freedesktop.resolve1.NoNameServers")) {
|
||||||
|
+ cb_data_complete(cb_data, NM_CONNECTIVITY_LIMITED, "resolve-error");
|
||||||
|
+ return;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ /* Never mind. Just let do curl do its own resolving. */
|
||||||
|
do_curl_request(cb_data);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
--
|
||||||
|
2.37.2
|
||||||
|
|
Loading…
x
Reference in New Issue
Block a user