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

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