Problems attempting to use ad-hoc mode, link state remains dormant
by Diego Santa Cruz
Hello,
I am trying to establish an ad-hoc connection between two Linux devices using iwd but so far I have not had any success without manual intervention. In short the link state remains dormant and no packets can be sent.
I succeeded to do it manually with iw inspiring me from https://wiki.lm-technologies.com/linux-wifi-ad-hoc-mode/. I did the following on each of the devices (iwd was not running).
* iw phy phy0 interface add ibs0 type ibss
* ip link set ibs0 up
* iw dev ibs0 ibss join ibstest 2437
After a few seconds the two devices connected and "iw dev ibs0 link" showed (same MAC address on both)
Joined IBSS 86:ac:e8:60:15:f3 (on ibs0)
SSID: ibstest
freq: 2437
And "ip link show dev ibs0" shows
5: ibs0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP mode DEFAULT group default qlen 1000
link/ether 3c:6a:a7:51:6d:dd brd ff:ff:ff:ff:ff:ff
And I can successfully ping the local-link IPv6 address of the other device.
With iwd I do the following to establish ad-hoc networking.
* Reboot to start with a clean state
* Start iwd
* iwctl device wlan0 set-property Mode ad-hoc
* iwctl ad-hoc wlan0 start_open ibstest
A few seconds later the two devices do connect, I see the a "new Station" message from one of the iwd, and "iw dev wlan0 link" shows the same MAC address on both devices, so as far as I understand they are joined.
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?
One of the devices is using an Intel Wireless AC 9260 and the other one an Intel Wireless 8265 / 8275.
Thanks,
Diego
--
Diego Santa Cruz, PhD
Technology Architect
spinetix.com
10 months, 3 weeks
[PATCH 1/3] client: fix ad-hoc start_open DBus method name
by Diego Santa Cruz
Doing 'ad-hoc <wlan> start_open <"network name">' returned a
"No matching method found" error because start_open called
net.connman.iwd.AdHoc.Start instead of net.connman.iwd.AdHoc.StartOpen.
---
client/ad-hoc.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/client/ad-hoc.c b/client/ad-hoc.c
index 41d5e2aa..c90f9dd6 100644
--- a/client/ad-hoc.c
+++ b/client/ad-hoc.c
@@ -189,7 +189,7 @@ static enum cmd_status cmd_start_open(const char *device_name,
return CMD_STATUS_INVALID_VALUE;
}
- proxy_interface_method_call(adhoc_i, "Start", "s",
+ proxy_interface_method_call(adhoc_i, "StartOpen", "s",
check_errors_method_callback,
argv[0]);
--
2.18.1
10 months, 3 weeks
[PATCH 1/2] wsc: Clear the pin copy in wsc_generate_pin
by Andrew Zaborowski
---
src/wsc.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/src/wsc.c b/src/wsc.c
index e9ebe5f5..ba58b6d4 100644
--- a/src/wsc.c
+++ b/src/wsc.c
@@ -1137,6 +1137,7 @@ static struct l_dbus_message *wsc_generate_pin(struct l_dbus *dbus,
reply = l_dbus_message_new_method_return(message);
l_dbus_message_set_arguments(reply, "s", pin);
+ explicit_bzero(pin, 9);
return reply;
}
--
2.20.1
10 months, 3 weeks
Possible MFP problem
by Albert Pretorius
HiI was on IRC earlier about this problem: my new ZyXel router (and aruba access point) does not connect:
iwctl station wlan0 connect NetScannerOperation failed
In dmesg:[43884.555390] wlan0: authenticate with b8:d5:26:23:09:56
[43884.621472] wlan0: send auth to b8:d5:26:23:09:56 (try 1/3)
[43884.623257] wlan0: authenticated
[43884.626163] wlan0: associate with b8:d5:26:23:09:56 (try 1/3)
[43884.630009] wlan0: RX AssocResp from b8:d5:26:23:09:56 (capab=0x411 status=0 aid=1)
[43884.632790] wlan0: associated
[43884.656703] wlan0: deauthenticating from b8:d5:26:23:09:56 by local choice (Reason: 1=UNSPECIFIED)
The iwd debug logging up to failuret:src/network.c:network_connect()
src/network.c:network_connect_psk() ask_passphrase: false
src/station.c:station_enter_state() Old State: disconnected, new state: connecting
src/scan.c:scan_notify() Scan notification Trigger Scan(33)
src/station.c:station_netdev_event() Associating
src/scan.c:scan_notify() Scan notification New Scan Results(34)
src/netdev.c:netdev_link_notify() event 16 on ifindex 4
src/netdev.c:netdev_mlme_notify() MLME notification New Station(19)
src/netdev.c:netdev_mlme_notify() MLME notification Authenticate(37)
src/netdev.c:netdev_authenticate_event()
src/netdev.c:netdev_mlme_notify() MLME notification Associate(38)
src/netdev.c:netdev_associate_event()
src/netdev.c:netdev_mlme_notify() MLME notification Connect(46)
src/netdev.c:netdev_connect_event()
src/netdev.c:netdev_link_notify() event 16 on ifindex 4
src/netdev.c:netdev_link_notify() event 16 on ifindex 4
src/netdev.c:netdev_link_notify() event 16 on ifindex 4
src/netdev.c:netdev_link_notify() event 16 on ifindex 4
src/netdev.c:netdev_unicast_notify() Unicast notification 129
src/netdev.c:netdev_control_port_frame_event()
src/eapol.c:eapol_handle_ptk_1_of_4() ifindex=4
src/netdev.c:netdev_control_port_frame_cb() 0
src/netdev.c:netdev_unicast_notify() Unicast notification 129
src/netdev.c:netdev_control_port_frame_event()
src/eapol.c:eapol_handle_ptk_3_of_4() ifindex=4
src/netdev.c:netdev_set_gtk() 4
src/netdev.c:netdev_set_igtk() 4
src/station.c:station_handshake_event() Setting keys
src/netdev.c:netdev_set_tk() 4
src/netdev.c:netdev_control_port_frame_cb() 0
New Key for Group Mgmt failed for ifindex: 4
I noticed in debug log that the first difference between this new router and tethered mobile phone is this:src/netdev.c:netdev_set_igtk() 4
So being misguided and industrious I commented out the callback setting for IGTK at:https://git.kernel.org/pub/scm/network/wireless/iwd.git/tree/src/hands...
which works around the problem for me.I reverted that patch and created /etc/iwd/main.conf with:[General]
ManagementFrameProtection=0
which works but with the caveat that I now have to manually do iwctl connect and type the password in.
I attached the pcap and screen capture at the time of the failed connection attempt (unfortunately the pcap seems to be missing events that are on screen which is why I include both).
Please let me know if any more information is needed. Any help greatly appreciated.
many thankscheersalbert
ps. fwiw wpa_supplicant works fine, but I am not keen to use it.
11 months
[PATCH] test-runner: create pcap when logging
by James Prestwood
---
tools/test-runner.c | 16 +++++++++++++---
1 file changed, 13 insertions(+), 3 deletions(-)
diff --git a/tools/test-runner.c b/tools/test-runner.c
index 5b37a790..88bb50e1 100644
--- a/tools/test-runner.c
+++ b/tools/test-runner.c
@@ -1608,14 +1608,24 @@ static void terminate_iwd(pid_t iwd_pid)
static pid_t start_monitor(const char *test_name)
{
- char *argv[4];
+ char *argv[6];
+ char *write_arg;
+ pid_t pid;
+
+ write_arg = l_strdup_printf("%s/%s/monitor.pcap", log_dir, test_name);
argv[0] = "iwmon";
argv[1] = "--nortnl";
argv[2] = "--nowiphy";
- argv[3] = NULL;
+ argv[3] = "--write";
+ argv[4] = write_arg;
+ argv[5] = NULL;
- return execute_program(argv, environ, false, test_name);
+ pid = execute_program(argv, environ, false, test_name);
+
+ l_free(write_arg);
+
+ return pid;
}
static bool create_tmpfs_extra_stuff(char **tmpfs_extra_stuff)
--
2.21.1
11 months
[PATCH] test-runner: fix segfault running with --log non-root
by James Prestwood
When running test-runner as non-root the environment variables
SUDO_GID/SUDO_UID were unset, causing atoi to segfault. This replaces
atoi with strtol, and checks the existance of SUDO_GID/SUDO_UID
before trying to turn it into an integer. This patch also allows
the uid/gid to be read from the user if running as non-root.
Note: running as non-root does require the users permissions to be
setup properly. Directories and files are created when running with
logging, so if the user running test-runner does not have these
permissions the creation of these files will fail.
---
tools/test-runner.c | 14 ++++++++++++--
1 file changed, 12 insertions(+), 2 deletions(-)
diff --git a/tools/test-runner.c b/tools/test-runner.c
index 1adb8377..5b37a790 100644
--- a/tools/test-runner.c
+++ b/tools/test-runner.c
@@ -3095,6 +3095,8 @@ int main(int argc, char *argv[])
uint8_t actions = 0;
struct tm *timeinfo;
time_t t;
+ char *gid;
+ char *uid;
l_log_set_stderr();
@@ -3195,8 +3197,16 @@ int main(int argc, char *argv[])
time(&t);
timeinfo = localtime(&t);
- log_gid = atoi(getenv("SUDO_GID"));
- log_uid = atoi(getenv("SUDO_UID"));
+ gid = getenv("SUDO_GID");
+ uid = getenv("SUDO_UID");
+
+ if (!gid || !uid) {
+ log_gid = getgid();
+ log_uid = getuid();
+ } else {
+ log_gid = strtol(gid, NULL, 10);
+ log_uid = strtol(uid, NULL, 10);
+ }
snprintf(log_dir, sizeof(log_dir), "%s/run-%d-%d-%d-%d",
optarg, timeinfo->tm_year + 1900,
--
2.21.1
11 months
[PATCH] nlmon: fix -Wformat under musl 1.2.0
by Rosen Penev
musl 1.2.0 uses 64-bit time, even under 32-bit OSes. Cast to int64_t
and use the proper macro.
---
monitor/nlmon.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/monitor/nlmon.c b/monitor/nlmon.c
index 0aeaea31..1f269ff0 100644
--- a/monitor/nlmon.c
+++ b/monitor/nlmon.c
@@ -216,8 +216,9 @@ static void print_packet(const struct timeval *tv, char ident,
ts_pos += n;
}
- n = sprintf(ts_str + ts_pos, " %lu.%06lu",
- tv->tv_sec - time_offset, tv->tv_usec);
+ n = sprintf(ts_str + ts_pos, " %" PRId64 ".%06" PRId64,
+ (int64_t)tv->tv_sec - time_offset,
+ (int64_t)tv->tv_usec);
if (n > 0) {
ts_pos += n;
ts_len += n;
--
2.25.1
11 months