Wireless Daemon for Linux
 help / color / mirror / Atom feed
From: James Prestwood <prestwoj@gmail.com>
To: iwd@lists.01.org
Subject: [PATCH 3/4] test-runner: fix improper loading of radius_config
Date: Mon, 16 Mar 2020 12:22:41 -0700	[thread overview]
Message-ID: <20200316192242.15588-3-prestwoj@gmail.com> (raw)
In-Reply-To: <20200316192242.15588-1-prestwoj@gmail.com>

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

This key is special in hostapd, and was being treated as a normal hostapd
config file. This special radius config file needs to be kept unpaired from
any interfaces so now its passed in as a separate argument and appended to
the end of the hostapd execute command.
---
 tools/test-runner.c | 15 ++++++++++++---
 1 file changed, 12 insertions(+), 3 deletions(-)

diff --git a/tools/test-runner.c b/tools/test-runner.c
index 1f0bc4dd..320dea0b 100644
--- a/tools/test-runner.c
+++ b/tools/test-runner.c
@@ -989,7 +989,7 @@ static void stop_ofono(pid_t pid)
 }
 
 static pid_t start_hostapd(char **config_files, struct wiphy **wiphys,
-				const char *test_name)
+				const char *test_name, const char *radius_conf)
 {
 	char **argv;
 	pid_t pid;
@@ -1029,6 +1029,9 @@ static pid_t start_hostapd(char **config_files, struct wiphy **wiphys,
 		argv[idx++] = config_files[i];
 	}
 
+	if (radius_conf)
+		argv[idx++] = (void *)radius_conf;
+
 	if (verbose) {
 		argv[idx++] = "-d";
 		argv[idx++] = NULL;
@@ -1358,6 +1361,7 @@ static bool configure_hostapd_instances(struct l_settings *hw_settings,
 	int i;
 	char **hostapd_config_file_paths;
 	struct wiphy **wiphys;
+	const char *radius_config = NULL;
 
 	*phys_used = 0;
 
@@ -1398,8 +1402,12 @@ static bool configure_hostapd_instances(struct l_settings *hw_settings,
 			goto done;
 		}
 
-		if (!strcmp(hostap_keys[i], "radius_server"))
+		if (!strcmp(hostap_keys[i], "radius_server")) {
+			radius_config = l_settings_get_value(hw_settings,
+						HW_CONFIG_GROUP_HOSTAPD,
+						"radius_server");
 			continue;
+		}
 
 		for (wiphy_entry = l_queue_get_entries(wiphy_list);
 					wiphy_entry;
@@ -1478,7 +1486,8 @@ hostapd_done:
 	}
 
 	hostapd_pids_out[0] = start_hostapd(hostapd_config_file_paths, wiphys,
-						basename(config_dir_path));
+						basename(config_dir_path),
+						radius_config);
 	hostapd_pids_out[1] = -1;
 
 done:
-- 
2.21.1

  parent reply	other threads:[~2020-03-16 19:22 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-16 19:22 [PATCH 1/4] test-runner: fix crash if ofono is not installed James Prestwood
2020-03-16 19:22 ` [PATCH 2/4] test-runner: fix crash for tests using radius_server James Prestwood
2020-03-16 19:22 ` James Prestwood [this message]
2020-03-16 19:22 ` [PATCH 4/4] netdev: fix auth protocols not setting ->connected James Prestwood
2020-03-16 20:22 ` [PATCH 1/4] test-runner: fix crash if ofono is not installed Denis Kenzior

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=20200316192242.15588-3-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