[PATCH v4 1/3] wiphy: add beacon bits to RM Enabled Capabilities
by James Prestwood
This tells AP's that we support Passive, Active, and Table beacon
measurements.
---
src/wiphy.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/src/wiphy.c b/src/wiphy.c
index ef22c0d3..eb0dfcc9 100644
--- a/src/wiphy.c
+++ b/src/wiphy.c
@@ -1037,6 +1037,8 @@ static void wiphy_setup_rm_enabled_capabilities(struct wiphy *wiphy)
wiphy->rm_enabled_capabilities[0] = IE_TYPE_RM_ENABLED_CAPABILITIES;
wiphy->rm_enabled_capabilities[1] = 5;
+ /* Bits: Passive (4), Active (5), and Beacon Table (6) capabilities */
+ wiphy->rm_enabled_capabilities[2] = 0x70;
/*
* TODO: Support at least Link Measurement if TX_POWER_INSERTION is
--
2.17.1
2 years, 6 months
[PATCH v2] wsc: Check capability before adding .SimpleConfiguration interface
by Tim Kourt
---
src/wsc.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/src/wsc.c b/src/wsc.c
index bac6e0cc..1050aefd 100644
--- a/src/wsc.c
+++ b/src/wsc.c
@@ -1108,6 +1108,13 @@ static void wsc_add_interface(struct netdev *netdev)
struct l_dbus *dbus = dbus_get_bus();
struct wsc *wsc;
+ if (!wiphy_get_max_scan_ie_len(netdev_get_wiphy(netdev))) {
+ l_debug("Simple Configuration isn't supported by ifindex %u",
+ netdev_get_ifindex(netdev));
+
+ return;
+ }
+
wsc = l_new(struct wsc, 1);
wsc->netdev = netdev;
--
2.21.0
2 years, 6 months
[PATCH v3 1/3] wiphy: add beacon bits to RM Enabled Capabilities
by James Prestwood
This tells AP's that we support Passive, Active, and Table beacon
measurements.
---
src/wiphy.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/src/wiphy.c b/src/wiphy.c
index ef22c0d3..eb0dfcc9 100644
--- a/src/wiphy.c
+++ b/src/wiphy.c
@@ -1037,6 +1037,8 @@ static void wiphy_setup_rm_enabled_capabilities(struct wiphy *wiphy)
wiphy->rm_enabled_capabilities[0] = IE_TYPE_RM_ENABLED_CAPABILITIES;
wiphy->rm_enabled_capabilities[1] = 5;
+ /* Bits: Passive (4), Active (5), and Beacon Table (6) capabilities */
+ wiphy->rm_enabled_capabilities[2] = 0x70;
/*
* TODO: Support at least Link Measurement if TX_POWER_INSERTION is
--
2.17.1
2 years, 6 months
[PATCH 1/2] wiphy: Add parser and getter for max ie len attr
by Tim Kourt
---
src/wiphy.c | 12 ++++++++++++
src/wiphy.h | 1 +
2 files changed, 13 insertions(+)
diff --git a/src/wiphy.c b/src/wiphy.c
index ef22c0d3..4446abba 100644
--- a/src/wiphy.c
+++ b/src/wiphy.c
@@ -67,6 +67,7 @@ struct wiphy {
uint8_t ext_features[(NUM_NL80211_EXT_FEATURES + 7) / 8];
uint8_t max_num_ssids_per_scan;
uint32_t max_roc_duration;
+ uint16_t max_scan_ie_len;
uint16_t supported_iftypes;
uint16_t supported_ciphers;
struct scan_freq_set *supported_freqs;
@@ -363,6 +364,11 @@ uint8_t wiphy_get_max_num_ssids_per_scan(struct wiphy *wiphy)
return wiphy->max_num_ssids_per_scan;
}
+uint16_t wiphy_get_max_scan_ie_len(struct wiphy *wiphy)
+{
+ return wiphy->max_scan_ie_len;
+}
+
uint32_t wiphy_get_max_roc_duration(struct wiphy *wiphy)
{
return wiphy->max_roc_duration;
@@ -834,6 +840,12 @@ static void wiphy_parse_attributes(struct wiphy *wiphy,
wiphy->max_num_ssids_per_scan =
*((uint8_t *) data);
break;
+ case NL80211_ATTR_MAX_SCAN_IE_LEN:
+ if (len != sizeof(uint16_t))
+ l_warn("Invalid MAX_SCAN_IE_LEN attribute");
+ else
+ wiphy->max_scan_ie_len = *((uint16_t *) data);
+ break;
case NL80211_ATTR_SUPPORT_IBSS_RSN:
wiphy->support_adhoc_rsn = true;
break;
diff --git a/src/wiphy.h b/src/wiphy.h
index 85fa3f56..67eafe3c 100644
--- a/src/wiphy.h
+++ b/src/wiphy.h
@@ -64,6 +64,7 @@ bool wiphy_rrm_capable(struct wiphy *wiphy);
bool wiphy_has_feature(struct wiphy *wiphy, uint32_t feature);
bool wiphy_has_ext_feature(struct wiphy *wiphy, uint32_t feature);
uint8_t wiphy_get_max_num_ssids_per_scan(struct wiphy *wiphy);
+uint16_t wiphy_get_max_scan_ie_len(struct wiphy *wiphy);
uint32_t wiphy_get_max_roc_duration(struct wiphy *wiphy);
bool wiphy_supports_iftype(struct wiphy *wiphy, uint32_t iftype);
const uint8_t *wiphy_get_supported_rates(struct wiphy *wiphy, unsigned int band,
--
2.21.0
2 years, 6 months
[PATCH v2 1/2] test-runner: run iwmon if --log is used
by James Prestwood
Now that execute_program handles logging automatically its trivial
to add iwmon to the test and get monitor logs as well as normal
process output.
---
tools/test-runner.c | 19 +++++++++++++++++++
1 file changed, 19 insertions(+)
diff --git a/tools/test-runner.c b/tools/test-runner.c
index 00989391..1c807aea 100644
--- a/tools/test-runner.c
+++ b/tools/test-runner.c
@@ -1592,6 +1592,18 @@ static void terminate_iwd(pid_t iwd_pid)
kill_process(iwd_pid);
}
+static pid_t start_monitor(const char *test_name)
+{
+ char *argv[4];
+
+ argv[0] = "iwmon";
+ argv[1] = "--nortnl";
+ argv[2] = "--nowiphy";
+ argv[3] = NULL;
+
+ return execute_program(argv, environ, false, test_name);
+}
+
static bool create_tmpfs_extra_stuff(char **tmpfs_extra_stuff)
{
size_t i = 0;
@@ -2004,6 +2016,7 @@ static void create_network_and_run_tests(void *data, void *user_data)
pid_t medium_pid = -1;
pid_t ofono_pid = -1;
pid_t phonesim_pid = -1;
+ pid_t monitor_pid = -1;
char *config_dir_path;
char *iwd_config_dir;
char **tmpfs_extra_stuff = NULL;
@@ -2149,6 +2162,9 @@ static void create_network_and_run_tests(void *data, void *user_data)
l_queue_foreach(wiphy_list, wiphy_up, NULL);
}
+ if (log)
+ monitor_pid = start_monitor(test_name);
+
if (check_verbosity("tls"))
setenv("IWD_TLS_DEBUG", "on", true);
@@ -2233,6 +2249,9 @@ static void create_network_and_run_tests(void *data, void *user_data)
stop_phonesim(phonesim_pid);
}
+ if (monitor_pid > 0)
+ kill_process(monitor_pid);
+
exit_hostapd:
destroy_hostapd_instances(hostapd_pids);
--
2.17.1
2 years, 6 months
[PATCH v2 1/3] wiphy: add beacon bits to RM Enabled Capabilities
by James Prestwood
This tells AP's that we support Passive, Active, and Table beacon
measurements.
---
src/wiphy.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/src/wiphy.c b/src/wiphy.c
index ef22c0d3..eb0dfcc9 100644
--- a/src/wiphy.c
+++ b/src/wiphy.c
@@ -1037,6 +1037,8 @@ static void wiphy_setup_rm_enabled_capabilities(struct wiphy *wiphy)
wiphy->rm_enabled_capabilities[0] = IE_TYPE_RM_ENABLED_CAPABILITIES;
wiphy->rm_enabled_capabilities[1] = 5;
+ /* Bits: Passive (4), Active (5), and Beacon Table (6) capabilities */
+ wiphy->rm_enabled_capabilities[2] = 0x70;
/*
* TODO: Support at least Link Measurement if TX_POWER_INSERTION is
--
2.17.1
2 years, 6 months
[PATCH 1/2] test-runner: run iwmon if --log is used
by James Prestwood
Now that execute_program handles logging automatically its trivial
to add iwmon to the test and get monitor logs as well as normal
process output.
---
tools/test-runner.c | 19 +++++++++++++++++++
1 file changed, 19 insertions(+)
diff --git a/tools/test-runner.c b/tools/test-runner.c
index 00989391..1c807aea 100644
--- a/tools/test-runner.c
+++ b/tools/test-runner.c
@@ -1592,6 +1592,18 @@ static void terminate_iwd(pid_t iwd_pid)
kill_process(iwd_pid);
}
+static pid_t start_monitor(const char *test_name)
+{
+ char *argv[4];
+
+ argv[0] = "iwmon";
+ argv[1] = "--nortnl";
+ argv[2] = "--nowiphy";
+ argv[3] = NULL;
+
+ return execute_program(argv, environ, false, test_name);
+}
+
static bool create_tmpfs_extra_stuff(char **tmpfs_extra_stuff)
{
size_t i = 0;
@@ -2004,6 +2016,7 @@ static void create_network_and_run_tests(void *data, void *user_data)
pid_t medium_pid = -1;
pid_t ofono_pid = -1;
pid_t phonesim_pid = -1;
+ pid_t monitor_pid = -1;
char *config_dir_path;
char *iwd_config_dir;
char **tmpfs_extra_stuff = NULL;
@@ -2149,6 +2162,9 @@ static void create_network_and_run_tests(void *data, void *user_data)
l_queue_foreach(wiphy_list, wiphy_up, NULL);
}
+ if (log)
+ monitor_pid = start_monitor(test_name);
+
if (check_verbosity("tls"))
setenv("IWD_TLS_DEBUG", "on", true);
@@ -2233,6 +2249,9 @@ static void create_network_and_run_tests(void *data, void *user_data)
stop_phonesim(phonesim_pid);
}
+ if (monitor_pid > 0)
+ kill_process(monitor_pid);
+
exit_hostapd:
destroy_hostapd_instances(hostapd_pids);
--
2.17.1
2 years, 6 months
[PATCH] test-runner: special case python3 verbose option
by James Prestwood
Historically if you wanted to see output from a python test you needed
to specify -v pytests. This was also the case if IWD was started from
python.
Nearly every time I run test-runner I would specify "-v iwd,pytests"
only to get the IWD output on these specific tests.
Instead we can special case 'python3' (previously 'pytests') inside
execute_program so that turning on verbosity for 'iwd' also turns it
on for the python tests.
---
tools/test-runner.c | 16 ++++++++++------
1 file changed, 10 insertions(+), 6 deletions(-)
diff --git a/tools/test-runner.c b/tools/test-runner.c
index a83e1252..00989391 100644
--- a/tools/test-runner.c
+++ b/tools/test-runner.c
@@ -541,13 +541,17 @@ static pid_t execute_program(char *argv[], char *envp[], bool wait,
return -1;
/*
- * We have to special case this. execute_program automatically logs to
- * <process>.log, which would put all iwd output into valgrind.log
- * rather than iwd.log. Since we are explicitly having valgrind output
- * to a log file we can assume any output from this is only IWD, and not
- * valgrind.
+ * We have a few special cases here:
+ *
+ * Since execute_program automatically logs to <process>.log this would
+ * put all iwd output into valgrind.log rather than iwd.log. Since we
+ * are explicitly having valgrind output to a log file we can assume any
+ * output from this is only IWD, and not valgrind.
+ *
+ * python3 is special cased so that tests which start IWD manually can
+ * still show IWD output when using -v iwd.
*/
- if (!strcmp(log_name, "valgrind"))
+ if (!strcmp(log_name, "valgrind") || !strcmp(log_name, "python3"))
log_name = "iwd";
str = l_strjoinv(argv, ' ');
--
2.17.1
2 years, 6 months
[PATCH] test-runner: refactor/fix valgrind logging issue
by James Prestwood
After the logging changes verbose IWD with valgrind did not show any IWD
output. This commit fixes this by checking the verbosity against log_name
rather than argv[0] since log_name has a special case for valgrind/iwd.
The valgrind logic in start_iwd was refactored to only use the --log-fd
option rather than using --log-file in addition to --log-fd.
---
tools/test-runner.c | 20 +++++++++++---------
1 file changed, 11 insertions(+), 9 deletions(-)
diff --git a/tools/test-runner.c b/tools/test-runner.c
index 5ef9552e..a83e1252 100644
--- a/tools/test-runner.c
+++ b/tools/test-runner.c
@@ -564,7 +564,7 @@ static pid_t execute_program(char *argv[], char *envp[], bool wait,
int fd = -1;
L_AUTO_FREE_VAR(char *, log_file) = NULL;
- verbose = check_verbosity(argv[0]);
+ verbose = check_verbosity(log_name);
/* No stdout and no logging */
if (!verbose && !log)
@@ -1493,6 +1493,7 @@ static pid_t start_iwd(const char *config_dir, struct l_queue *wiphy_list,
L_AUTO_FREE_VAR(char *, fd_option) = NULL;
if (valgrind) {
+ L_AUTO_FREE_VAR(char *, valgrind_log);
int fd;
argv[idx++] = "valgrind";
@@ -1501,21 +1502,22 @@ static pid_t start_iwd(const char *config_dir, struct l_queue *wiphy_list,
/*
* Valgrind needs --log-fd if we want both stderr and stdout
*/
- if (log) {
- L_AUTO_FREE_VAR(char *, valgrind_log);
-
+ if (log)
valgrind_log = l_strdup_printf("%s/%s/valgrind.log",
log_dir, test_name);
- fd = open(valgrind_log, O_WRONLY | O_CREAT | O_APPEND,
+ else
+ valgrind_log = l_strdup("/tmp/valgrind.log");
+
+ fd = open(valgrind_log, O_WRONLY | O_CREAT | O_APPEND,
S_IRUSR | S_IWUSR);
+ if (log) {
if (fchown(fd, log_uid, log_gid) < 0)
l_error("chown failed");
+ }
- fd_option = l_strdup_printf("--log-fd=%d", fd);
- argv[idx++] = fd_option;
- } else
- argv[idx++] = "--log-file=/tmp/valgrind.log";
+ fd_option = l_strdup_printf("--log-fd=%d", fd);
+ argv[idx++] = fd_option;
}
if (strcmp(gdb_opt, "iwd") == 0) {
--
2.17.1
2 years, 6 months
[PATCH v2] peap: Adjust V0 not to close tunnel on Success of Phase2
by Tim Kourt
---
src/eap-peap.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/src/eap-peap.c b/src/eap-peap.c
index c8949ca2..e7d23dca 100644
--- a/src/eap-peap.c
+++ b/src/eap-peap.c
@@ -182,17 +182,19 @@ static void eap_extensions_handle_request(struct eap_state *eap,
eap_peap_phase2_send_response(response, sizeof(response), eap);
- eap_tls_common_tunnel_close(eap);
-
eap_discard_success_and_failure(eap, false);
eap_tls_common_set_completed(eap);
if (r != EAP_EXTENSIONS_RESULT_SUCCCESS) {
eap_tls_common_set_phase2_failed(eap);
+ eap_tls_common_tunnel_close(eap);
+
return;
}
+ eap_tls_common_send_empty_response(eap);
+
eap_method_success(eap);
}
--
2.13.6
2 years, 6 months