Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 897742 - net-misc/connman: iwd USE flag does not make connman use iwd, it still uses wpa_supplicant
Summary: net-misc/connman: iwd USE flag does not make connman use iwd, it still uses w...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Ben Kohler
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-02-25 20:17 UTC by Piotr Karbowski (RETIRED)
Modified: 2023-03-01 09:55 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Piotr Karbowski (RETIRED) gentoo-dev 2023-02-25 20:17:54 UTC
connman when built with iwd USE flag will start and use wpa_supplicant even if iwd is already running.

This become a problem when user have to use iwd over wpa_supplicant. 

In my case I have a 6 GHz (wifi 6e) access point with wpa3 that I cannot connect to with connman when it uses wpa_supplicant, I suspect it has more to do with wpa3 than the 6 GHz radio.

Since connman call dbus to get wpa_supplicant up we would either need to have iwd flag block net-wireless/wpa_supplicant from being present, or patch connman to stop calling wpa_supplicant dbus service when built with iwd USE flag.

In short, currently connman will *always* use wpa_supplicant even when iwd USE flag is enabled.
Comment 1 Ben Kohler gentoo-dev 2023-02-25 20:44:50 UTC
I'll work on this but I'm curious why you have wpa_supplicant installed if you don't want to use it.  It's optional everywhere that I'm aware of.

Maybe I need to rework the USE logic on connman to be more like NM, which has:

    wifi? (
        !iwd? ( >=net-wireless/wpa_supplicant-0.7.3-r3[dbus] )
        iwd? ( net-wireless/iwd )
    )
Comment 2 Piotr Karbowski (RETIRED) gentoo-dev 2023-02-25 20:52:23 UTC
The wpa_supplicant is behind wifi USE. I was under impression I still need it even if I will use iwd. This is why I have wpa_supplicant around.

However a moment ago I got response from Jade Lovelace and it seems there are smarts to make connmand use iwd regardless.

   --wifi=iwd_agent

Passed to connmand, as in https://github.com/NixOS/nixpkgs/blob/master/nixos/modules/services/networking/connman.nix#L120

Would it be possible for you to make new snapshot ebuild beside init script changes? Seems like autoconnect do not work and I see 2 related commits at the very top of master branch that claim to fix those.
Comment 3 Piotr Karbowski (RETIRED) gentoo-dev 2023-02-25 20:55:50 UTC
Forgot to comment on the USE flags changes: I like it, but user might still have wpa_supplicant around so init script changes would be much needed, similar to how now 'iwd' is added to openrc init script as dependency.
Comment 4 Piotr Karbowski (RETIRED) gentoo-dev 2023-02-25 21:41:05 UTC
Just for the record. I can confirm that using '--wifi=iwd_agent' and connman-9999 gets the expected results (though it uses old/wrong init script, no 'need iwd').

Unrelated to this bug, but related to wifi 6e in Gentoo, I came across some weird issues where even iwctl from iwd stops seeing the 6 GHz access point until I restart the AP. My mobile phone does not stop seeing it though even when PC looses it. Perhaps some incompatibility between ax210 and this particular AP. Early adopters tax.
Comment 5 Larry the Git Cow gentoo-dev 2023-02-26 15:09:04 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=ecc7f72c31b5e952a1214f09d6ede36efe900820

commit ecc7f72c31b5e952a1214f09d6ede36efe900820
Author:     Ben Kohler <bkohler@gentoo.org>
AuthorDate: 2023-02-26 15:05:48 +0000
Commit:     Ben Kohler <bkohler@gentoo.org>
CommitDate: 2023-02-26 15:08:58 +0000

    net-misc/connman: new snapshot, rework wifi flags, rework deps
    
    Wifi flag logic now matcheshow NM works. USE="wifi -iwd" for wpa_supplicant
    backend, USE="wifi iwd" for iwd backend.
    
    Several deps were moved to runtime-only.
    
    Bug: https://bugs.gentoo.org/897742
    
    Signed-off-by: Ben Kohler <bkohler@gentoo.org>

 net-misc/connman/Manifest                        |   1 +
 net-misc/connman/connman-1.42_pre20230116.ebuild | 133 +++++++++++++++++++++++
 2 files changed, 134 insertions(+)
Comment 6 Ben Kohler gentoo-dev 2023-02-26 15:09:51 UTC
I've made an attempt, let me know how it looks and works for you
Comment 7 Piotr Karbowski (RETIRED) gentoo-dev 2023-02-26 19:35:06 UTC
Looks good to me and after a little change it works. On the line 128 of new ebuild I think it should use ${T} not ${FILESDIR} to get the modified file.

What do you think about moving the --wifi=iwd_agent to init script instead of conf.d? With conf.d it is possible that user will not get the new version after changing USE flags, unless they add '--noconfmem' to emerge if they changed back and forth, I am definitely one of people who would run into this kind of problem when juggling USE flags around, that could lead into entirely broken wifi.

While anecdotal I'd like to share that the 6 GHz network works with those connman+iwd changes, but it breaks after I disconnect from AP or reboot machine, this looks like AP side issue, though worth mentioning, perhaps others will find it useful.

Regardless of 6 GHz witchcraft, the changes to support iwd are much appreciated, thanks! Simply by switching from wpa_supplicant to iwd it seems to shave latency greatly, simple 'ping cachefly.cachefly.net' with wpa_supplicant here is about 30-34ms over wifi and 19-20ms over ethernet, however with iwd the ping is 22-24ms over wifi, huge improvement with the same hardware. Than
Comment 8 Ben Kohler gentoo-dev 2023-02-28 15:04:55 UTC
Oops yeah I forgot to make the ${T} change later in the ebuild.  Fix incoming.  WRT init.d vs conf.d holding the extra argument, I don't really care one way or the other, but I believe the same config protection / confmem issue will apply in both cases, moving it to init.d doesn't change anything really.
Comment 9 Larry the Git Cow gentoo-dev 2023-02-28 15:06:01 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=75ad9ddbf2941707168df619a58bcc10a04a913a

commit 75ad9ddbf2941707168df619a58bcc10a04a913a
Author:     Ben Kohler <bkohler@gentoo.org>
AuthorDate: 2023-02-28 15:05:14 +0000
Commit:     Ben Kohler <bkohler@gentoo.org>
CommitDate: 2023-02-28 15:05:52 +0000

    net-misc/connman: actually install modified conf.d file for USE=iwd
    
    Bug: https://bugs.gentoo.org/897742
    
    Signed-off-by: Ben Kohler <bkohler@gentoo.org>

 ...nnman-1.42_pre20230116.ebuild => connman-1.42_pre20230116-r1.ebuild} | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Comment 10 Piotr Karbowski (RETIRED) gentoo-dev 2023-02-28 15:22:27 UTC
I think the thing that changes is, by default Portage will auto-merge unchanged files, and users rarely edit the init.d one, chance why it should by default always have correct values (feature config-protect-if-modified), however users are encouraged to modify conf.d files, which will lead to dispatch-conf prompting user to update /etc/conf.d/connman with new flag and give him chance to not agree to it. Sure it might be the same if you have FEATURES=-config-protect-if-modified but my thinking here is -- if it's inside init.d, it is much harder for user to hurt themselves accidentally when running default-ish Gentoo installation.
Comment 11 Larry the Git Cow gentoo-dev 2023-02-28 15:40:45 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=cd6dc648847c71be099f47a2304e131c5249fe43

commit cd6dc648847c71be099f47a2304e131c5249fe43
Author:     Ben Kohler <bkohler@gentoo.org>
AuthorDate: 2023-02-28 15:39:58 +0000
Commit:     Ben Kohler <bkohler@gentoo.org>
CommitDate: 2023-02-28 15:40:39 +0000

    net-misc/connman: move iwd cmdline parameter from conf.d to init.d
    
    Bug: https://bugs.gentoo.org/897742
    
    Signed-off-by: Ben Kohler <bkohler@gentoo.org>

 ...2_pre20230116-r1.ebuild => connman-1.42_pre20230116-r2.ebuild} | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)
Comment 12 Piotr Karbowski (RETIRED) gentoo-dev 2023-03-01 09:55:04 UTC
Looks good to me. I will close the bug now since we have it all sorted out. Thanks for the changes.