From: Tim Kourt <tim.a.kourt@linux.intel.com>
To: iwd@lists.01.org
Subject: [PATCH] client: Fix missing Connected Network display
Date: Thu, 06 Feb 2020 08:51:58 -0800 [thread overview]
Message-ID: <20200206165158.19014-1-tim.a.kourt@linux.intel.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 2241 bytes --]
The connected network wasn’t displayed correctly within Station
object when connection was created before the start of iwctl
due to object dependency and timing of the sequential parsing of
the Object Manager’s objects. The issue is corrected by storing
the network path and doing lookups of the network proxy objects
at the time of display.
---
client/station.c | 23 +++++++++++++++--------
1 file changed, 15 insertions(+), 8 deletions(-)
diff --git a/client/station.c b/client/station.c
index b6b59239..86e18f06 100644
--- a/client/station.c
+++ b/client/station.c
@@ -35,7 +35,7 @@
struct station {
bool scanning;
char *state;
- const struct proxy_interface *connected_network;
+ char *connected_network;
};
static void *station_create(void)
@@ -48,7 +48,7 @@ static void station_destroy(void *data)
struct station *station = data;
l_free(station->state);
- station->connected_network = NULL;
+ l_free(station->connected_network);
l_free(station);
}
@@ -106,14 +106,15 @@ static void update_connected_network(void *data,
struct station *station = data;
const char *path;
+ l_free(station->connected_network);
+
if (!l_dbus_message_iter_get_variant(variant, "o", &path)) {
station->connected_network = NULL;
return;
}
- station->connected_network = proxy_interface_find(IWD_NETWORK_INTERFACE,
- path);
+ station->connected_network = l_strdup(path);
}
static const struct proxy_interface_property station_properties[] = {
@@ -145,10 +146,16 @@ static void display_station(const char *device_name,
proxy_properties_display(proxy, caption, MARGIN, 20, 47);
l_free(caption);
- if (station->connected_network)
- display("%s%*s %-*s%-*s\n", MARGIN, 8, "", 20,
- "Connected network", 47,
- network_get_name(station->connected_network));
+ if (station->connected_network) {
+ const struct proxy_interface *network_proxy =
+ proxy_interface_find(IWD_NETWORK_INTERFACE,
+ station->connected_network);
+
+ if (network_proxy)
+ display("%s%*s %-*s%-*s\n", MARGIN, 8, "", 20,
+ "Connected network", 47,
+ network_get_name(network_proxy));
+ }
display_table_footer();
}
--
2.13.6
reply other threads:[~2020-02-06 16:51 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200206165158.19014-1-tim.a.kourt@linux.intel.com \
--to=tim.a.kourt@linux.intel.com \
--cc=iwd@lists.01.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.