diff options
| author | Michael Biebl <biebl@debian.org> | 2019-07-31 10:51:42 +0200 |
|---|---|---|
| committer | Michael Biebl <biebl@debian.org> | 2019-07-31 10:51:42 +0200 |
| commit | 2e5fa45ddfbb5cffa1e78221f1cea706e2f298af (patch) | |
| tree | 86f69d36c56de3074280456eddc854a780b8e04b /src/dns | |
| parent | 85563b7fc7ec2cd21e38debb9b28db342e2e8e7c (diff) | |
New upstream version 1.19.90 upstream/1.19.90
Diffstat (limited to 'src/dns')
| -rw-r--r-- | src/dns/nm-dns-dnsmasq.c | 1 | ||||
| -rw-r--r-- | src/dns/nm-dns-dnsmasq.h | 1 | ||||
| -rw-r--r-- | src/dns/nm-dns-manager.c | 1 | ||||
| -rw-r--r-- | src/dns/nm-dns-manager.h | 1 | ||||
| -rw-r--r-- | src/dns/nm-dns-plugin.c | 1 | ||||
| -rw-r--r-- | src/dns/nm-dns-plugin.h | 1 | ||||
| -rw-r--r-- | src/dns/nm-dns-systemd-resolved.c | 76 | ||||
| -rw-r--r-- | src/dns/nm-dns-systemd-resolved.h | 1 | ||||
| -rw-r--r-- | src/dns/nm-dns-unbound.c | 1 | ||||
| -rw-r--r-- | src/dns/nm-dns-unbound.h | 1 |
10 files changed, 25 insertions, 60 deletions
diff --git a/src/dns/nm-dns-dnsmasq.c b/src/dns/nm-dns-dnsmasq.c index b54df730..13576c92 100644 --- a/src/dns/nm-dns-dnsmasq.c +++ b/src/dns/nm-dns-dnsmasq.c @@ -1,4 +1,3 @@ -/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ /* * Copyright (C) 2010 Dan Williams <dcbw@redhat.com> * diff --git a/src/dns/nm-dns-dnsmasq.h b/src/dns/nm-dns-dnsmasq.h index cbba434b..7623d167 100644 --- a/src/dns/nm-dns-dnsmasq.h +++ b/src/dns/nm-dns-dnsmasq.h @@ -1,4 +1,3 @@ -/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ /* This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2, or (at your option) diff --git a/src/dns/nm-dns-manager.c b/src/dns/nm-dns-manager.c index 27c3e710..2c55bee9 100644 --- a/src/dns/nm-dns-manager.c +++ b/src/dns/nm-dns-manager.c @@ -1,4 +1,3 @@ -/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ /* NetworkManager -- Network link manager * * This program is free software; you can redistribute it and/or modify diff --git a/src/dns/nm-dns-manager.h b/src/dns/nm-dns-manager.h index 7f6ed3ed..1cb2c669 100644 --- a/src/dns/nm-dns-manager.h +++ b/src/dns/nm-dns-manager.h @@ -1,4 +1,3 @@ -/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ /* NetworkManager -- Network link manager * * This program is free software; you can redistribute it and/or modify diff --git a/src/dns/nm-dns-plugin.c b/src/dns/nm-dns-plugin.c index ce814186..582abc62 100644 --- a/src/dns/nm-dns-plugin.c +++ b/src/dns/nm-dns-plugin.c @@ -1,4 +1,3 @@ -/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ /* This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2, or (at your option) diff --git a/src/dns/nm-dns-plugin.h b/src/dns/nm-dns-plugin.h index 8a55921d..98bda7cf 100644 --- a/src/dns/nm-dns-plugin.h +++ b/src/dns/nm-dns-plugin.h @@ -1,4 +1,3 @@ -/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ /* This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2, or (at your option) diff --git a/src/dns/nm-dns-systemd-resolved.c b/src/dns/nm-dns-systemd-resolved.c index 5d262ba3..69b3e45e 100644 --- a/src/dns/nm-dns-systemd-resolved.c +++ b/src/dns/nm-dns-systemd-resolved.c @@ -1,4 +1,3 @@ -/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ /* * Copyright (C) 2010 Dan Williams <dcbw@redhat.com> * Copyright (C) 2016 Sjoerd Simons <sjoerd@luon.net> @@ -32,6 +31,7 @@ #include <linux/if.h> #include "nm-glib-aux/nm-c-list.h" +#include "nm-glib-aux/nm-dbus-aux.h" #include "nm-core-internal.h" #include "platform/nm-platform.h" #include "nm-utils.h" @@ -304,18 +304,12 @@ send_updates (NMDnsSystemdResolved *self) _LOGT ("send-updates: no name owner. Try start service..."); priv->try_start_blocked = TRUE; - g_dbus_connection_call (priv->dbus_connection, - DBUS_SERVICE_DBUS, - DBUS_PATH_DBUS, - DBUS_INTERFACE_DBUS, - "StartServiceByName", - g_variant_new ("(su)", SYSTEMD_RESOLVED_DBUS_SERVICE, 0u), - G_VARIANT_TYPE ("(u)"), - G_DBUS_CALL_FLAGS_NONE, - -1, - NULL, - NULL, - NULL); + nm_dbus_connection_call_start_service_by_name (priv->dbus_connection, + SYSTEMD_RESOLVED_DBUS_SERVICE, + -1, + NULL, + NULL, + NULL); return; } @@ -474,24 +468,17 @@ name_owner_changed_cb (GDBusConnection *connection, } static void -get_name_owner_cb (GObject *source, - GAsyncResult *res, +get_name_owner_cb (const char *name_owner, + GError *error, gpointer user_data) { NMDnsSystemdResolved *self; NMDnsSystemdResolvedPrivate *priv; - gs_unref_variant GVariant *ret = NULL; - gs_free_error GError *error = NULL; - const char *owner = NULL; - ret = g_dbus_connection_call_finish (G_DBUS_CONNECTION (source), res, &error); - if ( !ret + if ( !name_owner && g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED)) return; - if (ret) - g_variant_get (ret, "(&s)", &owner); - self = user_data; priv = NM_DNS_SYSTEMD_RESOLVED_GET_PRIVATE (self); @@ -499,7 +486,7 @@ get_name_owner_cb (GObject *source, priv->dbus_initied = TRUE; - name_owner_changed (self, owner); + name_owner_changed (self, name_owner); } /*****************************************************************************/ @@ -527,35 +514,24 @@ nm_dns_systemd_resolved_init (NMDnsSystemdResolved *self) c_list_init (&priv->request_queue_lst_head); - priv->dbus_connection = nm_g_object_ref (nm_dbus_manager_get_dbus_connection (nm_dbus_manager_get ())); + priv->dbus_connection = nm_g_object_ref (NM_MAIN_DBUS_CONNECTION_GET); if (!priv->dbus_connection) { _LOGD ("no D-Bus connection"); return; } - priv->name_owner_changed_id = g_dbus_connection_signal_subscribe (priv->dbus_connection, - DBUS_SERVICE_DBUS, - DBUS_INTERFACE_DBUS, - "NameOwnerChanged", - DBUS_PATH_DBUS, - SYSTEMD_RESOLVED_DBUS_SERVICE, - G_DBUS_SIGNAL_FLAGS_NONE, - name_owner_changed_cb, - self, - NULL); + priv->name_owner_changed_id = nm_dbus_connection_signal_subscribe_name_owner_changed (priv->dbus_connection, + SYSTEMD_RESOLVED_DBUS_SERVICE, + name_owner_changed_cb, + self, + NULL); priv->cancellable = g_cancellable_new (); - g_dbus_connection_call (priv->dbus_connection, - DBUS_SERVICE_DBUS, - DBUS_PATH_DBUS, - DBUS_INTERFACE_DBUS, - "GetNameOwner", - g_variant_new ("(s)", SYSTEMD_RESOLVED_DBUS_SERVICE), - G_VARIANT_TYPE ("(s)"), - G_DBUS_CALL_FLAGS_NONE, - -1, - priv->cancellable, - get_name_owner_cb, - self); + nm_dbus_connection_call_get_name_owner (priv->dbus_connection, + SYSTEMD_RESOLVED_DBUS_SERVICE, + -1, + priv->cancellable, + get_name_owner_cb, + self); } NMDnsPlugin * @@ -572,10 +548,8 @@ dispose (GObject *object) free_pending_updates (self); - if (priv->name_owner_changed_id != 0) { - g_dbus_connection_signal_unsubscribe (priv->dbus_connection, - nm_steal_int (&priv->name_owner_changed_id)); - } + nm_clear_g_dbus_connection_signal (priv->dbus_connection, + &priv->name_owner_changed_id); nm_clear_g_cancellable (&priv->cancellable); diff --git a/src/dns/nm-dns-systemd-resolved.h b/src/dns/nm-dns-systemd-resolved.h index b79ff5e4..14e31e2b 100644 --- a/src/dns/nm-dns-systemd-resolved.h +++ b/src/dns/nm-dns-systemd-resolved.h @@ -1,4 +1,3 @@ -/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ /* This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2, or (at your option) diff --git a/src/dns/nm-dns-unbound.c b/src/dns/nm-dns-unbound.c index b900f29e..9e10950a 100644 --- a/src/dns/nm-dns-unbound.c +++ b/src/dns/nm-dns-unbound.c @@ -1,4 +1,3 @@ -/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ /* * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/dns/nm-dns-unbound.h b/src/dns/nm-dns-unbound.h index 100ff2c4..743699ea 100644 --- a/src/dns/nm-dns-unbound.h +++ b/src/dns/nm-dns-unbound.h @@ -1,4 +1,3 @@ -/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ /* This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2, or (at your option) |