Wireless Daemon for Linux
 help / color / mirror / Atom feed
From: James Prestwood <prestwoj@gmail.com>
To: iwd@lists.01.org
Subject: [PATCH 2/5] client: ap: handle NotFound on diagnostic interface
Date: Mon, 01 Feb 2021 14:05:15 -0800	[thread overview]
Message-ID: <20210201220518.36975-2-prestwoj@gmail.com> (raw)
In-Reply-To: <20210201220518.36975-1-prestwoj@gmail.com>

[-- Attachment #1: Type: text/plain, Size: 994 bytes --]

This can happen when 'ap <wlan> show' is used on an AP interface
which has not been started. This isn't an error per-se so it
should be handled and print nothing rather than print an error.
---
 client/ap.c | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/client/ap.c b/client/ap.c
index 7130bb9a..9a7f8642 100644
--- a/client/ap.c
+++ b/client/ap.c
@@ -201,9 +201,18 @@ static void ap_get_diagnostics_callback(struct l_dbus_message *message,
 	struct l_dbus_message_iter iter;
 	uint16_t idx = 0;
 	char client_num[15];
+	const char *name;
+	const char *text;
 
-	if (dbus_message_has_error(message))
+	if (l_dbus_message_get_error(message, &name, &text)) {
+		if (!strcmp(name, "net.connman.iwd.NotFound")) {
+			display_table_footer();
+			return;
+		}
+
+		display_error(text);
 		return;
+	}
 
 	if (!l_dbus_message_get_arguments(message, "aa{sv}", &array)) {
 		display("Failed to parse GetDiagnostics message");
-- 
2.26.2

  reply	other threads:[~2021-02-01 22:05 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-01 22:05 [PATCH 1/5] ap: return error from GetDiagnostics if not started James Prestwood
2021-02-01 22:05 ` James Prestwood [this message]
2021-02-01 22:05 ` [PATCH 3/5] ap: add SSID property James Prestwood
2021-02-01 22:05 ` [PATCH 4/5] doc: document SSID property on AP interface James Prestwood
2021-02-01 22:21   ` Denis Kenzior
2021-02-01 22:05 ` [PATCH 5/5] client: ap: show SSID in 'ap <wlan> show' James Prestwood
2021-02-01 22:10   ` James Prestwood

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=20210201220518.36975-2-prestwoj@gmail.com \
    --to=prestwoj@gmail.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox