iwd + connman
by Jupiter
Hi Daniel and Denis,
I got a final hardware prototype to run iwd + connman, the WiFi works
with wpa_supplicant, now I changed to use iwd version 1.26 and connman
version 1.41.
I have 2 network interfaces, an 4G LTE and a WiFi so I want to use
connman to control interface connection PreferredTechnologies =
wifi,cellular.
Following your advice, I set up EnableNetworkConfiguration=false in
/etc/iwd/main.conf, the WiFi was connected, but no IP address. Here is
detailed debug:
On 12/3/21, Daniel Wagner <wagi(a)monom.org> wrote:
> On 30.11.21 23:42, Denis Kenzior wrote:
>> Note that for iwd + connman, connman would be the one performing DHCP
>> and iwd should use EnableNetworkConfiguration=false. Daniel can correct
>> me if I'm wrong.
>
> This is correct. Though I think it should be possible to change this.
> For example for VPN the VPN service tells ConnMan the IP configuration
> to use. The iwd plugin could do the amse and tell the ConnMan core which
> IP configuration to use.
$ cat /etc/iwd/main.conf
[General]
EnableNetworkConfiguration=false
ControlPortOverNL80211=false
UseDefaultInterface=true
AddressRandomization=false
The WiFi interface is connected:
$ iwctl station mlan0 show
Station: mlan0
--------------------------------------------------------------------------------
Settable Property Value
--------------------------------------------------------------------------------
Scanning no
State connected
Connected network JupiterIoT
No IP addresses Is DHCP client configured?
ConnectedBss 34:08:04:12:b1:a2
Frequency 2437
Security WPA2-Personal
RSSI -54 dBm
TxMode 802.11n
TxMCS 2
TxBitrate 19500 Kbit/s
RxBitrate 1000 Kbit/s
The DHCP works as well:
# udhcpc -i mlan0
udhcpc: started, v1.35.0
udhcpc: broadcasting discover
udhcpc: broadcasting select for 192.168.0.101, server 192.168.0.1
udhcpc: lease of 192.168.0.101 obtained from 192.168.0.1, lease time 86400
But there is no IP address:
$ ifconfig
mlan0 Link encap:Ethernet HWaddr D4:CA:6E:A4:E8:E0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:188 errors:0 dropped:0 overruns:0 frame:0
TX packets:60 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:11256 (10.9 KiB) TX bytes:6990 (6.8 KiB)
What I could be missing in iwd configuration?
The iwd also kept showing the following message, the 34:XX:XX:XX:b1:a2
is not the wlan MAC address, what did that mean?
[ 8456.501736] wlan: Send EAPOL pkt to 34:XX:XX:XX:b1:a2
Thank you.
Kind regards,
Jupiter
3 weeks, 3 days
[PATCH 1/3] storage: remove unused variables
by James Prestwood
The auto macros apparently made it difficult for gcc to
detect, but clang was able to find them.
---
src/storage.c | 2 --
1 file changed, 2 deletions(-)
diff --git a/src/storage.c b/src/storage.c
index aa8066b1..2100d08d 100644
--- a/src/storage.c
+++ b/src/storage.c
@@ -456,11 +456,9 @@ char *__storage_encrypt(const struct l_settings *settings, const char *name,
int __storage_decrypt(struct l_settings *settings, const char *ssid,
bool *encrypt)
{
- _auto_(l_settings_free) struct l_settings *security = NULL;
_auto_(l_free) uint8_t *encrypted = NULL;
_auto_(l_free) uint8_t *decrypted = NULL;
_auto_(l_free) uint8_t *salt = NULL;
- _auto_(l_strv_free) char **embedded = NULL;
_auto_(l_strv_free) char **groups = NULL;
char **i;
size_t elen, slen;
--
2.34.1
1 month, 1 week
Possible recursive locking detected DEADLOCK
by Jupiter
Hi,
My device is running NXP moal WiFi driver and iwd version 1.26, after
running iwctl wifi connection, there was a kernel warning message to
indicate a concurrency issue, here is what I understand scenarios:
- iwctl/425 is trying to acquire a lock.
- The moal was already holding the lock by moal_spin_lock (why??)
- It was a deadlock, I think it was caused by unsafe moal spin lock,
but it could also be an issue in iwd, I have no expertise on both,
please check it and explain.
$ iwctl --passphrase "passphase" station mlan0 connect "JupiterIoT"
[ 191.669316] ============================================
[ 191.674657] WARNING: possible recursive locking detected
[ 191.680000] 5.10.81 #1 Not tainted
[ 191.683422] --------------------------------------------
[ 191.688759] iwctl/425 is trying to acquire lock:
[ 191.693404] caf8f610 (&mlock->lock){..-.}-{2:2}, at:
moal_spin_lock+0x10/0x1c [moal]
[ 191.701649]
but task is already holding lock:
[ 191.707508] caf8f3d0 (&mlock->lock){..-.}-{2:2}, at:
moal_spin_lock+0x10/0x1c [moal]
[ 191.715643]
other info that might help us debug this:
[ 191.722194] Possible unsafe locking scenario:
[ 191.728137] CPU0
[ 191.730603] ----
[ 191.733069] lock(&mlock->lock);
[ 191.736434] lock(&mlock->lock);
[ 191.739796]
*** DEADLOCK ***
[ 191.745736] May be due to missing lock nesting notation
[ 191.752551] 8 locks held by iwctl/425:
[ 191.756325] #0: caf75cb0 ((&idev->mc_ifc_timer)){+.-.}-{0:0}, at:
call_timer_fn+0x0/0x3bc
[ 191.764713] #1: c87dfaa8 (rcu_read_lock){....}-{1:2}, at:
mld_sendpack+0x0/0x904
[ 191.772309] #2: c87dfabc (rcu_read_lock_bh){....}-{1:2}, at:
ip6_finish_output2+0x74/0xf40
[ 191.780768] #3: c87dfabc (rcu_read_lock_bh){....}-{1:2}, at:
__dev_queue_xmit+0x4c/0xc48
[ 191.789051] #4: ca18ad74 (dev->qdisc_tx_busylock ?:
&qdisc_tx_busylock){+...}-{2:2}, at: __dev_queue_xmit+0x430/0xc48
[ 191.799852] #5: ca18acb4 (dev->qdisc_running_key ?:
&qdisc_running_key){+...}-{0:0}, at: ip6_finish_output2+0x218/0xf40
[ 191.810823] #6: cb1e8a50 (_xmit_ETHER#2){+.-.}-{2:2}, at:
sch_direct_xmit+0x168/0x2e0
[ 191.818855] #7: caf8f3d0 (&mlock->lock){..-.}-{2:2}, at:
moal_spin_lock+0x10/0x1c [moal]
[ 191.827423]
stack backtrace:
[ 191.831818] CPU: 0 PID: 425 Comm: iwctl Not tainted 5.10.81 #1
[ 191.837678] Hardware name: Freescale i.MX6 Ultralite (Device Tree)
[ 191.843920] [<c01103e0>] (unwind_backtrace) from [<c010b960>]
(show_stack+0x10/0x14)
[ 191.851717] [<c010b960>] (show_stack) from [<c0a05e00>]
(dump_stack+0xdc/0x104)
[ 191.859074] [<c0a05e00>] (dump_stack) from [<c01849d8>]
(__lock_acquire+0x153c/0x3018)
[ 191.867037] [<c01849d8>] (__lock_acquire) from [<c0186ef0>]
(lock_acquire+0x128/0x418)
[ 191.875007] [<c0186ef0>] (lock_acquire) from [<c0a1622c>]
(_raw_spin_lock_irqsave+0x58/0x74)
[ 191.883777] [<c0a1622c>] (_raw_spin_lock_irqsave) from [<bf173c78>]
(moal_spin_lock+0x10/0x1c [moal])
[ 191.893629] [<bf173c78>] (moal_spin_lock [moal]) from [<bf0ef46c>]
(wlan_get_station_entry+0x3c/0xc0 [mlan])
[ 191.903920] [<bf0ef46c>] (wlan_get_station_entry [mlan]) from
[<bf0f9f04>] (wlan_wmm_add_buf_txqueue+0x2f0/0x448 [mlan])
[ 191.915218] [<bf0f9f04>] (wlan_wmm_add_buf_txqueue [mlan]) from
[<bf0decd4>] (mlan_send_packet+0x1c8/0x394 [mlan])
[ 191.926120] [<bf0decd4>] (mlan_send_packet [mlan]) from
[<bf16007c>] (woal_start_xmit+0x108/0x890 [moal])
[ 191.936297] [<bf16007c>] (woal_start_xmit [moal]) from [<bf160870>]
(woal_hard_start_xmit+0x6c/0x140 [moal])
[ 191.946449] [<bf160870>] (woal_hard_start_xmit [moal]) from
[<c0793bf8>] (dev_hard_start_xmit+0x110/0x3c0)
[ 191.956158] [<c0793bf8>] (dev_hard_start_xmit) from [<c07d7be0>]
(sch_direct_xmit+0xfc/0x2e0)
[ 191.964727] [<c07d7be0>] (sch_direct_xmit) from [<c07d7f38>]
(__qdisc_run+0x174/0x6e4)
[ 191.972688] [<c07d7f38>] (__qdisc_run) from [<c07947e0>]
(__dev_queue_xmit+0x86c/0xc48)
[ 191.980738] [<c07947e0>] (__dev_queue_xmit) from [<c08861c8>]
(ip6_finish_output2+0x218/0xf40)
[ 191.989404] [<c08861c8>] (ip6_finish_output2) from [<c08c3988>]
(mld_sendpack+0x70c/0x904)
[ 191.997722] [<c08c3988>] (mld_sendpack) from [<c08c45c4>]
(mld_ifc_timer_expire+0x1e4/0x488)
[ 192.006209] [<c08c45c4>] (mld_ifc_timer_expire) from [<c01be63c>]
(call_timer_fn+0xc4/0x3bc)
[ 192.014695] [<c01be63c>] (call_timer_fn) from [<c01beb78>]
(__run_timers.part.0+0x244/0x3b8)
[ 192.023174] [<c01beb78>] (__run_timers.part.0) from [<c01bed1c>]
(run_timer_softirq+0x30/0x68)
[ 192.031827] [<c01bed1c>] (run_timer_softirq) from [<c0101448>]
(__do_softirq+0x180/0x5b4)
[ 192.040049] [<c0101448>] (__do_softirq) from [<c012bb10>]
(__irq_exit_rcu+0x150/0x1cc)
[ 192.048012] [<c012bb10>] (__irq_exit_rcu) from [<c012bf24>]
(irq_exit+0x8/0x28)
[ 192.055365] [<c012bf24>] (irq_exit) from [<c01967a8>]
(__handle_domain_irq+0x78/0xd4)
[ 192.063242] [<c01967a8>] (__handle_domain_irq) from [<c056b458>]
(gic_handle_irq+0x78/0x9c)
[ 192.071638] [<c056b458>] (gic_handle_irq) from [<c0100b30>]
(__irq_svc+0x70/0x98)
[ 192.079149] Exception stack(0xcaf75de0 to 0xcaf75e28)
[ 192.084247] 5de0: ffffffff ffffffff 00000001 00000b89 600b0013
c8868300 cb02809c 00000020
[ 192.092465] 5e00: 00000185 600b0013 caf75e4c c8867600 00000000
caf75e30 c0a164b0 c0a16490
[ 192.100668] 5e20: 600b0013 ffffffff
[ 192.104211] [<c0100b30>] (__irq_svc) from [<c0a16490>]
(_raw_spin_unlock_irqrestore+0x2c/0x50)
[ 192.112876] [<c0a16490>] (_raw_spin_unlock_irqrestore) from
[<c0252eb8>] (release_pages+0x1f4/0x2f0)
[ 192.122056] [<c0252eb8>] (release_pages) from [<c0289d50>]
(tlb_finish_mmu+0x70/0x194)
[ 192.130017] [<c0289d50>] (tlb_finish_mmu) from [<c0287984>]
(exit_mmap+0xfc/0x180)
[ 192.137638] [<c0287984>] (exit_mmap) from [<c011ffa8>] (mmput+0x4c/0xf8)
[ 192.144385] [<c011ffa8>] (mmput) from [<c0128cdc>] (do_exit+0x358/0xb18)
[ 192.151127] [<c0128cdc>] (do_exit) from [<c012a790>]
(do_group_exit+0x38/0xb4)
[ 192.158389] [<c012a790>] (do_group_exit) from [<c012a81c>]
(__wake_up_parent+0x0/0x14)
Please contact me if you require more debug information.
Thank you.
Kind regards,
Jupiter
1 month, 2 weeks
[ANNOUNCE] IWD switching to new mailing list
by James Prestwood
Hello All,
IWD is swiching to a new mailing list: iwd(a)lists.linux.dev. This list
is currently active and ready so any future patches, questions, or
comments can be sent there!
You might be wondering, why is this being done? The reason for this
change is to enable an automated CI for IWD to catch regressions, build
breaks, or any other issues which previously required manual testing.
You will see the CI results from you're changes in patchwork:
https://patchwork.kernel.org/project/iwd/list/
Note the CI is still in a trial stage, so email notifications have been
disabled. You will not receive any notifications about test results but
know that maintainers are checking the results and will point you to
any problems that are found.
If you have any questions please don't hesitate to ask.
Thanks,
James
1 month, 3 weeks
[PATCH] HACKING: update to use new mailing list
by James Prestwood
IWD will be switching to a new mailing list iwd(a)lists.linux.dev.
This list is active already, and any new patches should be sent
there.
---
HACKING | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/HACKING b/HACKING
index 5925490e..8a84a449 100644
--- a/HACKING
+++ b/HACKING
@@ -5,7 +5,7 @@ If you fixed a bug or you want to add support for something, patches are
welcome! The preferred method of submitting the patches to the project is by
email to the iwd mailing list:
- iwd(a)lists.01.org
+ iwd(a)lists.linux.dev
In order to ease the inclusion of your patch, it's important to follow
some rules, otherwise it will likely be rejected by maintainers.
--
2.34.1
1 month, 3 weeks
[PATCH] monitor: fix integer comparison error (clang)
by James Prestwood
Though the documentation for NLMSG_OK uses an int type for the length
the actual check is based on nlmsghdr->nlmsg_len which is a 32 bit
unsigned integer. Clang was complaining about one call in nlmon.c
because nlmsg_len was int type. Every other usage in nlmon.c uses
a uint32_t, so use that both for consistency and to fix the warning.
monitor/nlmon.c:7998:29: error: comparison of integers of different
signs: '__u32' (aka 'unsigned int') and 'int'
[-Werror,-Wsign-compare]
for (nlmsg = iov.iov_base; NLMSG_OK(nlmsg, nlmsg_len);
^~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/linux/netlink.h:100:24: note: expanded from macro 'NLMSG_OK'
(nlh)->nlmsg_len <= (len))
---
monitor/nlmon.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/monitor/nlmon.c b/monitor/nlmon.c
index fe967922..34c5eed6 100644
--- a/monitor/nlmon.c
+++ b/monitor/nlmon.c
@@ -7944,7 +7944,7 @@ static bool nlmon_receive(struct l_io *io, void *user_data)
unsigned char buf[8192];
unsigned char control[32];
ssize_t bytes_read;
- int nlmsg_len;
+ uint32_t nlmsg_len;
int fd;
fd = l_io_get_fd(io);
--
2.34.1
2 months
[PATCH] fils: pragma false positive for uninitialized variable
by James Prestwood
On musl-gcc the compiler is giving a warning for igtk_key_index
and gtk_key_index being used uninitialized. This isn't possible
since they are only used if gtk/igtk are non-NULL so pragma to
ignore the warning.
src/fils.c: In function 'fils_rx_associate':
src/fils.c:580:17: error: 'igtk_key_index' may be used uninitialized
in this function [-Werror=maybe-uninitialized]
580 | handshake_state_install_igtk(fils->hs,
igtk_key_index,igtk + 6,
igtk_len - 6, igtk);
(same error for gtk_key_index)
---
src/fils.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/src/fils.c b/src/fils.c
index d1d46d65..c3337352 100644
--- a/src/fils.c
+++ b/src/fils.c
@@ -572,6 +572,8 @@ static int fils_rx_associate(struct auth_proto *driver, const uint8_t *frame,
handshake_state_set_pmk(fils->hs, fils->pmk, fils->pmk_len);
handshake_state_set_pmkid(fils->hs, fils->pmkid);
+_Pragma("GCC diagnostic push")
+_Pragma("GCC diagnostic ignored \"-Wmaybe-uninitialized\"")
if (gtk)
handshake_state_install_gtk(fils->hs, gtk_key_index, gtk,
gtk_len, key_rsc, 6);
@@ -579,6 +581,7 @@ static int fils_rx_associate(struct auth_proto *driver, const uint8_t *frame,
if (igtk)
handshake_state_install_igtk(fils->hs, igtk_key_index,
igtk + 6, igtk_len - 6, igtk);
+_Pragma("GCC diagnostic pop")
handshake_state_set_ptk(fils->hs, fils->kek_and_tk, fils->kek_len + 16);
handshake_state_install_ptk(fils->hs);
--
2.34.1
2 months
How can AutoCAD help?
by gowofan444@nzaif.com
SevenMentor is really one of the most popular brands of AutoCad Training in Pune for Computer Backed Drawing( CAD) which helps produce arrangements for structures and townships on your computer. The USP of the software is that it allows structural experts to draw everything in precise detail and to gauge and can be used to design any kindofstructure.What makes AutoCAD Classes in Pune special for professionals is that it's packed with features that make the process of creating 2D and 3D delineations extremely indefectible. The delineations thus created look real and can help imagine what the terrain being created will actually look like. masterminds can also remove or add features real- time to meliorate the overall aesthetics oftheproject.AutoCAD enables creation of near-real 3D models with solids, shells and snare objects. In addition, you can also automate tasks analogous as comparing delineations, counting, adding blocks, creating schedules and further.
It also comes with sedulity-specific toolsets like Architecture toolset, Mechanical toolset, Map 3D toolset, MEP toolset, Electrical toolset, plant 3D toolset, Raster Design toolset, among others that suit the conditions of different professionals and offers an advanced connected experience across different platforms allowing for easier collaborations and train sharing.
In keeping with the nippy changes in technology, the Online AutoCAD Training in Pune offers indefectible connections with the web and mobile apps. With the conversion to Cloud, the 3D models created can be rendered online without consuming processing power or scrap space on your computer, which is a real boon for heavy design lines that are created usingthissoftware.Such is the power of Cloud that you can enjoy a connected design experience across CAD Courses in Pune on nearly any device and do n’t inevitably need a computer with high configurations.
https://www.sevenmentor.com/autocad-classes-in-pune.php
2 months
[PATCH] autotests: Work around wpa_s config issue in testP2P
by Andrew Zaborowski
Since commit 922fa099721903b106a7bc1ccd1ffe8c4a7bce69 in hostap, our
setting of config_methods on P2P-client interface was ignored. Work
around that commit, in addition to the previous workaround we have in
this test, to again ensure the correct config_methods value is used.
---
autotests/testP2P/connection_test.py | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/autotests/testP2P/connection_test.py b/autotests/testP2P/connection_test.py
index 383e0cef..479076e8 100644
--- a/autotests/testP2P/connection_test.py
+++ b/autotests/testP2P/connection_test.py
@@ -87,7 +87,12 @@ class Test(unittest.TestCase):
# For some reason wpa_supplicant's newly created P2P-client interface doesn't inherit
# the settings from the main interface which were loaded from the config file
# (P2P-device and P2P-GO interfaces do), we need to set config_methods again.
+ #
+ # Additionally since hostap commit 922fa099721903b106a7bc1ccd1ffe8c4a7bce69,
+ # just setting config_methods to the same value we used last time is detected as
+ # a NOOP so we need to set it to a different value first for it to take effect.
peer_ifname = 'p2p-' + wpas.interface.name + '-0'
+ wpas.set('config_methods', '', ifname=peer_ifname)
wpas.set('config_methods', wpas.config['config_methods'], ifname=peer_ifname)
wpas.set('device_name', wpas.config['device_name'], ifname=peer_ifname)
wpas.set('device_type', wpas.config['device_type'], ifname=peer_ifname)
--
2.34.1
2 months
[PATCH] test-runner: allow regex for verbose option
by James Prestwood
The glob match was completely broken for --verbose because globs
are actually path matches, not generally for strings. Instead
match based on regular expressions.
First the verbose option was fixed to store it as an array as well
as write any list arguments into the kernel command line properly
(str() would include []). This has worked up until now because the
'in' keyword in python will work on strings just as well
as lists, for example:
>>> 'test' in 'this,is,a,test'
True
Then, the glob match was replaced with a regex match. Any exceptions
are caught and somewhat ignored (printed, but only seen with --debug).
This only guards against fatal exceptions from a user passing an
invalid expression.
---
tools/runner.py | 7 +++++--
tools/utils.py | 11 +++++++----
2 files changed, 12 insertions(+), 6 deletions(-)
diff --git a/tools/runner.py b/tools/runner.py
index ccc931ff..2ce26de0 100644
--- a/tools/runner.py
+++ b/tools/runner.py
@@ -72,7 +72,10 @@ class RunnerNamespace(Namespace):
if v in [None, False, [], '']:
continue
- ret += '%s=%s ' % (k, str(v))
+ if type(v) is list:
+ ret += '%s=%s ' % (k, ','.join(v))
+ else:
+ ret += '%s=%s ' % (k, str(v))
return ret.strip()
@@ -89,7 +92,7 @@ class RunnerCoreArgParse(ArgumentParser):
default=None,
type=os.path.abspath)
self.add_argument('--verbose', '-v', metavar='<list>',
- type=str,
+ type=lambda x: x.split(','),
help='Comma separated list of applications',
dest='verbose',
default=[])
diff --git a/tools/utils.py b/tools/utils.py
index 55db4227..d16f221f 100644
--- a/tools/utils.py
+++ b/tools/utils.py
@@ -8,7 +8,7 @@ import dbus
from gi.repository import GLib
from weakref import WeakValueDictionary
-from glob import glob
+from re import match
from runner import RunnerCoreArgParse
@@ -95,10 +95,13 @@ class Process(subprocess.Popen):
if process == 'valgrind' and 'iwd' in Process.testargs.verbose:
return True
- # Handle any glob matches
+ # Handle any regex matches
for item in Process.testargs.verbose:
- if process in glob(item):
- return True
+ try:
+ if match(item, process):
+ return True
+ except Exception as e:
+ print("%s is not a valid regex" % item)
return False
--
2.34.1
2 months, 1 week