bluez/0001-hostname-Fix-BlueZ-5.XX-adapter-name-on-startup.patch
Bastien Nocera d3a3a8bf3b + bluez-5.47-3
Fix adapter name not picking up PrettyHostname
2017-09-20 14:54:22 +02:00

39 lines
1.3 KiB
Diff

From cba55944f76ad0f01bb7c8976fd6699f058c68cd Mon Sep 17 00:00:00 2001
From: Bastien Nocera <hadess@hadess.net>
Date: Wed, 20 Sep 2017 14:42:14 +0200
Subject: [PATCH] hostname: Fix "BlueZ 5.XX" adapter name on startup
The hostname plugin listens to property changes from systemd-hostnamed
but doesn't fetch initial values. This means that unless the
PrettyHostname or StaticHostname changes, the default adapter will be
called "BlueZ 5.XX" matching the version number.
This is the case since the hostname plugin replaced the adaptername
plugin in 2012.
Fetch the initial values for PrettyHostname, StaticHostname and
Chassis when the plugin is initiated, so as to make the values
available for adapter setup.
---
plugins/hostname.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/plugins/hostname.c b/plugins/hostname.c
index f876d0afb..db9187378 100644
--- a/plugins/hostname.c
+++ b/plugins/hostname.c
@@ -307,6 +307,10 @@ static int hostname_init(void)
hostname_proxy = NULL;
g_dbus_client_unref(hostname_client);
hostname_client = NULL;
+ } else {
+ g_dbus_proxy_refresh_property(hostname_proxy, "PrettyHostname");
+ g_dbus_proxy_refresh_property(hostname_proxy, "StaticHostname");
+ g_dbus_proxy_refresh_property(hostname_proxy, "Chassis");
}
return err;
--
2.14.1