DBus Systemd Unit Dependency
by iwd@goodbit.net
My Arch linux laptop hangs 90 seconds during shutdown due to NFS client unmount timeouts.
Networking on this machine is WiFi only, controlled via iwd and systemd-networkd.
This is a day-one issue with iwd for me, and does not occur using wpa_supplicant.
Digging into the logs, I see dbus being spontaneously killed prior to iwd gracefully disconnecting.
This of course causes iwd to prematurely terminate, causing my NFS unmount hangs
Mar 11 16:40:54 x360 iwd[465]: D-Bus disconnected, quitting...
Mar 11 16:40:54 x360 iwd[465]: Removing scan context for wdev 2
Mar 11 16:40:54 x360 systemd[1]: Stopping D-Bus System Message Bus...
Mar 11 16:40:54 x360 kernel: wlan0: deauthenticating from c6:**:1f:**:65:** by local choice (Reason: 3=DEAUTH_LEAVING)
Mar 11 16:40:54 x360 systemd[1]: dbus.service: Succeeded.
Mar 11 16:40:54 x360 systemd[1]: Stopped D-Bus System Message Bus.
Mar 11 16:40:54 x360 audit[1]: SERVICE_STOP pid=1 uid=0 auid=4294967295 ses=4294967295 msg='unit=dbus comm="systemd" e>
Mar 11 16:40:54 x360 systemd[1]: Unmounting /mnt/fast...
Mar 11 16:40:54 x360 systemd-networkd[421]: wlan0: Link DOWN
...
Mar 11 16:42:24 x360 systemd[1]: mnt-fast.mount: Unmounting timed out. Terminating.
Mar 11 16:42:24 x360 systemd[1]: mnt-fast.mount: Mount process exited, code=killed, status=15/TERM
Mar 11 16:42:24 x360 systemd[1]: mnt-fast.mount: Failed with result 'timeout'.
The supplied iwd.service file does not specifically state dbus as a dependency.
(It happens to work because dbus always started very early)
I have corrected my shutdown hang issue using the following override:
$ cat /etc/systemd/system/iwd.service.d/override.conf
[Unit]
BindsTo=dbus.service
After=dbus.service
2 years, 3 months
how to disable colorized/grey output from iwctl commands
by KeithG
I am trying to move to connman/iwd from netctl on a RPi. It currently has a
PHP based UI to display the info and allow connections, etc. Connmanctl
commands respond with text (no control characters, no colorization) iwdctl
responds with text with control characters. If I use this command::
iwctl station wlan0 get-networks
I get a response which looks like clear txt in my linux terminal connected
by ssh, but it has control characters indicating which network is connected
and the signal strength stars are all present and are either full
brightness of grey depending on the signal. THis makes it challenging to
feed this into php to be displayed in a browser... Is there a hidden flag
to turn this off? Can this be added? If there are other suggestions on how
to best deal with this, I am soliciting advice... What I get is this in php:
sysCmd($str) ### iwctl station wlan0 get-networks | sed -e '1,4d' | tr -s
' '
sysCmd() output: ### $data type = array
sysCmd() output: ### ['0'] => Edventures psk ***ESC[1;30m*ESC[0m
sysCmd() output: ### ['1'] => Oliwia2009 psk *ESC[1;30m***ESC[0m
sysCmd() output: ### ['2'] => HouseStark01 psk *ESC[1;30m***ESC[0m
sysCmd() output: ### ['3'] => ATTeHeTKI2 psk *ESC[1;30m***ESC[0m
sysCmd() output: ### ['4'] => monterrey psk *ESC[1;30m***ESC[0m
sysCmd() output: ### ['5'] => ATTxZIQ4wa psk *ESC[1;30m***ESC[0m
sysCmd() output: ### ['6'] => Wemo.Mini.25B open *ESC[1;30m***ESC[0m
sysCmd() output: ### ['7'] => xfinitywifi open *ESC[1;30m***ESC[0m
sysCmd() output: ### ['8'] => ESC[1;30m> ESC[0mspg2 psk ****
I am trying to figure out how to use sed to remove the control characters,
but tit would be easier if I could just turn it off. Is there a flag? Could
one be added?
Thanks,
Gearhead
2 years, 3 months
[PATCH] eap-tls-common.c: Fixed EAP-TLS connections when
EAP-TLS-CACert option omitted
by Louis Whitburn
iwd would fail to connect using EAP-TLS when no CA certificate was provided
as it checked for successful loading of the CA certificate instead of the client
certificate when attempting to load the client certificate.
diff --git a/src/eap-tls-common.c b/src/eap-tls-common.c
index d62d7ca5..a6125969 100644
--- a/src/eap-tls-common.c
+++ b/src/eap-tls-common.c
@@ -1138,7 +1138,7 @@ bool eap_tls_common_settings_load(struct eap_state *eap,
if (value) {
eap_tls->client_cert = eap_tls_load_client_cert(settings,
value);
- if (!eap_tls->ca_cert) {
+ if (!eap_tls->client_cert) {
l_error("Could not load ClientCert %s", value);
goto load_error;
}
2 years, 3 months
[PATCH V3] Makefile.am: Avoid redirection of input and output files
by Khem Raj
Ensure that directory is created before its written to
This can cause a build race in a highly parallelised build where a directory is not yet created but
output file is being written using redirection e.g.
rst2man.py --strict --no-raw --no-generator --no-datestamp < ../git/monitor/iwmon.rst > monitor/iwmon.1
/bin/sh: monitor/iwmon.1: No such file or directory
make[1]: *** [Makefile:3544: monitor/iwmon.1] Error 1
Signed-off-by: Khem Raj <raj.khem(a)gmail.com>
---
v2: create directory before emitting doc files into it
v3: No change, rebased on master
Makefile.am | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/Makefile.am b/Makefile.am
index 9d378d3d..ac83376e 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -631,8 +631,9 @@ SED_PROCESS = $(AM_V_GEN)$(MKDIR_P) $(dir $@) && $(SED) \
< $< > $@
if RUN_RST2MAN
-RST2MAN_PROCESS = $(AM_V_GEN)$(RST2MAN) --strict --no-raw --no-generator \
- --no-datestamp $< $@
+RST2MAN_PROCESS = $(AM_V_GEN)$(MKDIR_P) $(dir $@) && \
+ $(AM_V_GEN)$(RST2MAN) --strict --no-raw \
+ --no-generator --no-datestamp $< $@
else
RST2MAN_PROCESS = $(AM_V_GEN)test -f $@ || \
{ echo "Generated manual page $@ does not exist"; false; }
--
2.25.1
2 years, 3 months
[PATCH 1/2] test-runner: Add missing space between qemus arguments
by Daniel Wagner
---
tools/test-runner.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/test-runner.c b/tools/test-runner.c
index 6a3a29325ce8..c4623d790446 100644
--- a/tools/test-runner.c
+++ b/tools/test-runner.c
@@ -408,7 +408,7 @@ static bool start_qemu(void)
"mac80211_hwsim.radios=0 init=%s TESTHOME=%s "
"TESTVERBOUT=\'%s\' DEBUG_FILTER=\'%s\'"
"TEST_ACTION=%u TEST_ACTION_PARAMS=\'%s\' "
- "TESTARGS=\'%s\' PATH=\'%s\' VALGRIND=%u"
+ "TESTARGS=\'%s\' PATH=\'%s\' VALGRIND=%u "
"GDB=\'%s\' HW=\'%s\' SHELL=%u "
"LOG_PATH=\'%s\' LOG_UID=\'%d\' LOG_GID=\'%d\'",
check_verbosity("kernel") ? "ignore_loglevel" : "quiet",
--
2.25.1
2 years, 3 months
[PATCH V2] Makefile.am: Avoid redirection of input and output files
by Khem Raj
Ensure that directory is created before its written to
This can cause a build race in a highly parallelised build where a directory is not yet created but
output file is being written using redirection e.g.
rst2man.py --strict --no-raw --no-generator --no-datestamp < ../git/monitor/iwmon.rst > monitor/iwmon.1
/bin/sh: monitor/iwmon.1: No such file or directory
make[1]: *** [Makefile:3544: monitor/iwmon.1] Error 1
---
v2: create directory before emitting doc files into it
Makefile.am | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/Makefile.am b/Makefile.am
index 823b7d02..1bd0005c 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -626,8 +626,9 @@ SED_PROCESS = $(AM_V_GEN)$(MKDIR_P) $(dir $@) && $(SED) \
< $< > $@
if RUN_RST2MAN
-RST2MAN_PROCESS = $(AM_V_GEN)$(RST2MAN) --strict --no-raw --no-generator \
- --no-datestamp < $< > $@
+RST2MAN_PROCESS = $(AM_V_GEN)$(MKDIR_P) $(dir $@) && \
+ $(AM_V_GEN)$(RST2MAN) --strict --no-raw \
+ --no-generator --no-datestamp $< $@
else
RST2MAN_PROCESS = $(AM_V_GEN)test -f $@ || \
{ echo "Generated manual page $@ does not exist"; false; }
--
2.24.0
2 years, 3 months
[PATCH v3 1/3] iwd: define a maximum password length
by James Prestwood
---
src/iwd.h | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/src/iwd.h b/src/iwd.h
index 22223526..8b63aa7d 100644
--- a/src/iwd.h
+++ b/src/iwd.h
@@ -22,6 +22,13 @@
#define uninitialized_var(x) x = x
+/*
+ * Set a maximum to prevent sending too much data to the kernel when hashing
+ * the password (or any other crypto operations involving the password).
+ * This value is not tied to IEEE or any RFC's, just chosen to be long enough
+ */
+#define IWD_MAX_PASSWORD_LEN 2048
+
struct l_genl;
struct l_genl_family;
--
2.17.1
2 years, 3 months
[PATCH 1/4] iwd: define a maximum passphrase length
by James Prestwood
---
src/iwd.h | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/src/iwd.h b/src/iwd.h
index 22223526..5371d8e5 100644
--- a/src/iwd.h
+++ b/src/iwd.h
@@ -22,6 +22,15 @@
#define uninitialized_var(x) x = x
+/*
+ * Set a maximum to prevent sending too much data to the kernel when hashing
+ * the passphrase (or any other crypto operations involving the passphrase).
+ * This will also prevent potential stack overflows if the passphrase is put
+ * into EAP packets on the stack (EAP-GTC). This value is not tied to IEEE or
+ * any RFC's, just chosen to be long enough to not restrict a normal user.
+ */
+#define IWD_MAX_PASSPHRASE_LEN 2048
+
struct l_genl;
struct l_genl_family;
--
2.17.1
2 years, 3 months
[RFC/PATCH] Install iwd and ead into $sbindir rather than $libexecdir.
by Anton Khirnov
$libexecdir is supposed to contain "internal" binaries that are not
supposed to be executed "from the outside", e.g. directly by users.
Since iwd is a normal daemon that is directly executed from the outside,
$sbindir is the appropriate place for it.
---
Makefile.am | 8 ++++----
README | 4 ++--
src/iwd.service.in | 2 +-
wired/ead.service.in | 2 +-
4 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/Makefile.am b/Makefile.am
index 9d378d3d..9e033599 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -135,7 +135,7 @@ ell_libell_internal_la_SOURCES = $(ell_headers) $(ell_sources)
endif
bin_PROGRAMS =
-libexec_PROGRAMS =
+sbin_PROGRAMS =
noinst_PROGRAMS =
if DBUS_POLICY
@@ -185,7 +185,7 @@ eap_sources = src/eap.c src/eap.h src/eap-private.h \
src/mschaputil.h src/mschaputil.c
if DAEMON
-libexec_PROGRAMS += src/iwd
+sbin_PROGRAMS += src/iwd
src_iwd_SOURCES = src/main.c linux/nl80211.h src/iwd.h src/missing.h \
src/plugin.h src/plugin.c \
@@ -313,7 +313,7 @@ endif
endif
if WIRED
-libexec_PROGRAMS += wired/ead
+sbin_PROGRAMS += wired/ead
wired_ead_SOURCES = wired/main.c wired/ethdev.h wired/ethdev.c \
wired/network.h wired/network.c \
@@ -627,7 +627,7 @@ ell/ell.h: Makefile
done
SED_PROCESS = $(AM_V_GEN)$(MKDIR_P) $(dir $@) && $(SED) \
- -e 's,@libexecdir\@,$(libexecdir),g' \
+ -e 's,@sbindir\@,$(sbindir),g' \
< $< > $@
if RUN_RST2MAN
diff --git a/README b/README
index fed9cf62..cffb8b1b 100644
--- a/README
+++ b/README
@@ -80,7 +80,7 @@ configuration options which are generally useful and enabled by default:
Disable installation of Wireless daemon
By default the Wireless daemon binary iwd is enabled and
- placed into --libexecdir directory.
+ placed into --sbindir directory.
--disable-client
@@ -159,7 +159,7 @@ that can be enabled if the functionality is required:
Enable installation of Ethernet authentication daemon
This allows enabling the Ethernet daemon binary ead which
- is then placed into --libexecdir directory.
+ is then placed into --sbindir directory.
With this option the support for 802.1x for wired Ethernet
connections can be enabled. It provides its own D-Bus
diff --git a/src/iwd.service.in b/src/iwd.service.in
index 77819eaf..a85f11fb 100644
--- a/src/iwd.service.in
+++ b/src/iwd.service.in
@@ -6,7 +6,7 @@ Wants=network.target
[Service]
Type=dbus
BusName=net.connman.iwd
-ExecStart=@libexecdir@/iwd
+ExecStart=@sbindir@/iwd
NotifyAccess=main
LimitNPROC=1
Restart=on-failure
diff --git a/wired/ead.service.in b/wired/ead.service.in
index 387fdb68..49b998a5 100644
--- a/wired/ead.service.in
+++ b/wired/ead.service.in
@@ -6,7 +6,7 @@ Wants=network.target
[Service]
Type=dbus
BusName=net.connman.ead
-ExecStart=@libexecdir@/ead
+ExecStart=@sbindir@/ead
NotifyAccess=main
LimitNPROC=1
Restart=on-failure
--
2.20.1
2 years, 3 months
[PATCH v2 1/3] iwd: define a maximum passphrase length
by James Prestwood
---
src/iwd.h | 9 +++++++++
1 file changed, 9 insertions(+)
v2:
- Renamed to IWD_MAX_PASSWORD_LEN
diff --git a/src/iwd.h b/src/iwd.h
index 22223526..426af743 100644
--- a/src/iwd.h
+++ b/src/iwd.h
@@ -22,6 +22,15 @@
#define uninitialized_var(x) x = x
+/*
+ * Set a maximum to prevent sending too much data to the kernel when hashing
+ * the passphrase (or any other crypto operations involving the passphrase).
+ * This will also prevent potential stack overflows if the passphrase is put
+ * into EAP packets on the stack (EAP-GTC). This value is not tied to IEEE or
+ * any RFC's, just chosen to be long enough to not restrict a normal user.
+ */
+#define IWD_MAX_PASSWORD_LEN 2048
+
struct l_genl;
struct l_genl_family;
--
2.17.1
2 years, 3 months