Blame SOURCES/0001-hostname-Fix-BlueZ-5.XX-adapter-name-on-startup.patch

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