[PATCH 1/2] client: Rename window change signal for clarity
by Tim Kourt
---
client/display.c | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/client/display.c b/client/display.c
index 4a9f7be0..c285d1bc 100644
--- a/client/display.c
+++ b/client/display.c
@@ -40,7 +40,7 @@
#define IWD_PROMPT COLOR_GREEN "[iwd]" COLOR_OFF "# "
#define LINE_LEN 81
-static struct l_signal *resize_signal;
+static struct l_signal *window_change_signal;
static struct l_io *io;
static char dashed_line[LINE_LEN] = { [0 ... LINE_LEN - 2] = '-' };
static char empty_line[LINE_LEN] = { [0 ... LINE_LEN - 2] = ' ' };
@@ -634,7 +634,7 @@ void display_quit(void)
rl_crlf();
}
-static void signal_handler(void *user_data)
+static void window_change_signal_handler(void *user_data)
{
if (display_refresh.cmd)
display_refresh_reset();
@@ -678,7 +678,9 @@ void display_init(void)
setlinebuf(stdout);
- resize_signal = l_signal_create(SIGWINCH, signal_handler, NULL, NULL);
+ window_change_signal =
+ l_signal_create(SIGWINCH, window_change_signal_handler, NULL,
+ NULL);
rl_attempted_completion_function = command_completion;
rl_completion_display_matches_hook = display_completion_matches;
@@ -708,7 +710,7 @@ void display_exit(void)
l_io_destroy(io);
- l_signal_remove(resize_signal);
+ l_signal_remove(window_change_signal);
if (history_path)
write_history(history_path);
--
2.13.6
2 years, 2 months
Re: Problems attempting to use ad-hoc mode, link state remains
dormant
by Denis Kenzior
Hi Diego,
>> The tricky part is that adhoc doesn't initialize its own rtnl object, so
>> I need to think about a good fix for this.
>>
>
> Thanks for the information, indeed it looked to me that there was something missing but I could not really figure it out for sure from the code. I do not think I can help out there.
This should now be fixed upstream.
Regards,
-Denis
2 years, 2 months
[PATCH] auto-t: check linkmode/operstate in adhoc test (open)
by James Prestwood
A previous patch fixed the linkmode/operstate for open AdHoc networks.
---
autotests/testAdHoc/open_test.py | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/autotests/testAdHoc/open_test.py b/autotests/testAdHoc/open_test.py
index 815533bb..a3882a50 100644
--- a/autotests/testAdHoc/open_test.py
+++ b/autotests/testAdHoc/open_test.py
@@ -25,9 +25,9 @@ class Test(unittest.TestCase):
dev1.adhoc_wait_for_connected(dev2.address)
dev2.adhoc_wait_for_connected(dev1.address)
- #testutil.test_iface_operstate(dev1.name)
- #testutil.test_iface_operstate(dev2.name)
- #testutil.test_ifaces_connected(dev1.name, dev2.name)
+ testutil.test_iface_operstate(dev1.name)
+ testutil.test_iface_operstate(dev2.name)
+ testutil.test_ifaces_connected(dev1.name, dev2.name)
def test_connection_success(self):
wd = IWD(True)
--
2.21.1
2 years, 2 months
[PATCH 1/3] storage: Refactor dirs creation logic to cleanup on failure
by Tim Kourt
---
src/storage.c | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/src/storage.c b/src/storage.c
index a075d31d..00d93933 100644
--- a/src/storage.c
+++ b/src/storage.c
@@ -200,16 +200,24 @@ bool storage_create_dirs(void)
}
storage_path = l_strdup(state_dirs[0]);
- storage_hotspot_path = l_strdup_printf("%s/hotspot/", state_dirs[0]);
l_strv_free(state_dirs);
if (create_dirs(storage_path)) {
l_error("Failed to create %s", storage_path);
+
+ l_free(storage_path);
+
return false;
}
+ storage_hotspot_path = l_strdup_printf("%s/hotspot/", storage_path);
+
if (create_dirs(storage_hotspot_path)) {
l_error("Failed to create %s", storage_hotspot_path);
+
+ l_free(storage_path);
+ l_free(storage_hotspot_path);
+
return false;
}
--
2.13.6
2 years, 2 months
[PATCH] client: apply format attribute to two functions
by Rosen Penev
Clang was able to find these extra ones.
---
client/agent.c | 2 +-
client/display.h | 6 ++++--
2 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/client/agent.c b/client/agent.c
index b804b50d..157b61c0 100644
--- a/client/agent.c
+++ b/client/agent.c
@@ -303,7 +303,7 @@ static struct l_dbus_message *request_user_password_method_call(
username_prompt = l_strdup_printf(COLOR_BLUE PROMPT_USERNAME " "
COLOR_OFF "%s\n", username);
- display(username_prompt);
+ display("%s", username_prompt);
l_free(username_prompt);
display_agent_prompt(PROMPT_PASSWORD, true);
diff --git a/client/display.h b/client/display.h
index 2b0d8d7c..fbae0c67 100644
--- a/client/display.h
+++ b/client/display.h
@@ -32,8 +32,10 @@ struct command_family;
#define CLEAR_SCREEN "\033[2J"
#define MARGIN " "
-void display(const char *format, ...);
-void display_table_header(const char *caption, const char *fmt, ...);
+void display(const char *format, ...)
+ __attribute__((format(printf, 1, 2)));
+void display_table_header(const char *caption, const char *fmt, ...)
+ __attribute__((format(printf, 2, 3)));
void display_table_footer(void);
void display_error(const char *error);
void display_command_line(const char *command_family,
--
2.25.1
2 years, 2 months
[PATCH] client: Rephrase the wait messages
by Tim Kourt
---
client/display.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/client/display.c b/client/display.c
index cf74326d..4a9f7be0 100644
--- a/client/display.c
+++ b/client/display.c
@@ -548,7 +548,7 @@ void display_disable_cmd_prompt(void)
{
display_refresh_reset();
- rl_set_prompt("Waiting to connect to IWD");
+ rl_set_prompt("Waiting for IWD to start...");
printf("\r");
rl_on_new_line();
rl_redisplay();
@@ -685,7 +685,7 @@ void display_init(void)
rl_completer_quote_characters = "\"";
rl_erase_empty_line = 1;
- rl_callback_handler_install("Waiting for IWD to appear...",
+ rl_callback_handler_install("Waiting for IWD to start...",
readline_callback);
rl_redisplay();
--
2.13.6
2 years, 2 months
[PATCH] client: Rewrite workaround for readline
by Tim Kourt
Instead of calling display(""), explicitly use the sequence of
commands to force readline to properly update its internal state
and re-display the prompt.
---
client/display.c | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/client/display.c b/client/display.c
index 4bcf51a2..cf74326d 100644
--- a/client/display.c
+++ b/client/display.c
@@ -534,7 +534,14 @@ void display_enable_cmd_prompt(void)
rl_set_prompt(IWD_PROMPT);
- display("");
+ /*
+ * The following sequence of rl_* commands forces readline to properly
+ * update its internal state and re-display the new prompt.
+ */
+ rl_save_prompt();
+ rl_redisplay();
+ rl_restore_prompt();
+ rl_forced_update_display();
}
void display_disable_cmd_prompt(void)
--
2.13.6
2 years, 2 months
Re: Problems attempting to use ad-hoc mode, link state remains
dormant
by Denis Kenzior
Hi Diego,
> BTW, could you share what is the status of the wired 802.1x support? Is it something that can be relied upon?
Not sure what to say? It works on the networks we have access to. Are
there improvements that can be made? Sure..
The last question I can't really comment on. This is an open source
project and comes with no warranties. You'll have to perform your own
due diligence to answer that.
Regards,
-Denis
2 years, 2 months
Re: Problems attempting to use ad-hoc mode, link state remains
dormant
by Denis Kenzior
Hi Diego,
> However, I have another device with an Atheros QCA6174 (ath10k_pci driver) and if I put it into ap mode no other station sees it (Windows laptop, Linux laptop, iPhone). Do you know if there is anything special to do to use ap mode on these devices?
>
I'm not aware of any, but admittedly we're not actively focused on AP
mode at the moment, so it is a 'less developed' area of the iwd codebase.
Regards,
-Denis
2 years, 2 months
Re: Problems attempting to use ad-hoc mode, link state remains
dormant
by Denis Kenzior
Hi Diego,
> However, “ip link show dev wlan0" shows “NO-CARRIER” on both devices
> with state DORMANT and mode DORMANT.
>
> 5: wlan0: <NO-CARRIER,BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq
> state DORMANT mode DORMANT group default qlen 1000
>
> link/ether 34:e1:2d:24:03:42 brd ff:ff:ff:ff:ff:ff
>
> When doing it manually with iw the state was UP and the mode DEFAULT, so
> I manually changed the state with “ip link set wlan0 state up". After
> that “ip link” no longer shows NO-CARRIER and pings worked. Changing the
> mode was not necessary.
>
> Is there something that I am missing? Or maybe something which is
> missing in iwd in adhoc mode?
This is indeed a bug in iwd. We somehow missed sending the required
linkmode / operstate changes when adhoc is operated in the 'open' mode.
i.e. a call to l_rtnl_set_linkmode_and_operstate is missing in
src/adhoc.c adhoc_new_station() around line 415.
The tricky part is that adhoc doesn't initialize its own rtnl object, so
I need to think about a good fix for this.
Regards,
-Denis
2 years, 2 months