From b8af01b455448f2f746f8bd77b63b4f9f6fd072a Mon Sep 17 00:00:00 2001 From: Thomas Haller Date: Wed, 15 Feb 2017 13:26:54 +0100 Subject: [PATCH] wifi: also show the NM D-Bus path for the Wi-Fi AP in nm_wifi_ap_to_string() (cherry picked from commit 257484e7bac2813d0cf1bc922ef57e6b781b1c96) --- src/devices/wifi/nm-wifi-ap.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/devices/wifi/nm-wifi-ap.c b/src/devices/wifi/nm-wifi-ap.c index b60020ac3c..7de0838f97 100644 --- a/src/devices/wifi/nm-wifi-ap.c +++ b/src/devices/wifi/nm-wifi-ap.c @@ -622,6 +622,7 @@ nm_wifi_ap_to_string (const NMWifiAP *self, { const NMWifiAPPrivate *priv; const char *supplicant_id = "-"; + const char *export_path; guint32 chan; char b1[200]; @@ -630,10 +631,16 @@ nm_wifi_ap_to_string (const NMWifiAP *self, priv = NM_WIFI_AP_GET_PRIVATE (self); chan = nm_utils_wifi_freq_to_channel (priv->freq); if (priv->supplicant_path) - supplicant_id = strrchr (priv->supplicant_path, '/'); + supplicant_id = strrchr (priv->supplicant_path, '/') ?: supplicant_id; + + export_path = nm_exported_object_get_path (NM_EXPORTED_OBJECT (self)); + if (export_path) + export_path = strrchr (export_path, '/') ?: export_path; + else + export_path = "/"; g_snprintf (str_buf, buf_len, - "%17s %-32s [ %c %3u %3u%% %c W:%04X R:%04X ] %3us %s", + "%17s %-32s [ %c %3u %3u%% %c W:%04X R:%04X ] %3us sup:%s [nm:%s]", priv->address ?: "(none)", nm_sprintf_buf (b1, "%s%s%s", NM_PRINT_FMT_QUOTED (priv->ssid, "\"", nm_utils_escape_ssid (priv->ssid->data, priv->ssid->len), "\"", "(none)")), @@ -650,7 +657,8 @@ nm_wifi_ap_to_string (const NMWifiAP *self, priv->wpa_flags & 0xFFFF, priv->rsn_flags & 0xFFFF, priv->last_seen > 0 ? ((now_s > 0 ? now_s : nm_utils_get_monotonic_timestamp_s ()) - priv->last_seen) : -1, - supplicant_id); + supplicant_id, + export_path); return str_buf; }