You are not logged in.

#1 2020-06-18 17:25:22

idlepork
Member
From: Georgia
Registered: 2019-10-02
Posts: 10
Website

dhcpcd-9.1.2-1 isn't properly running wpa_supplicant hook

I upgraded to dhcpcd-9.1.2-1 from dhcpcd-9.1.1-1 today. I use dhcpcd with wpa_supplicant (wpa_supplicant.conf) to manage my wifi, and it's stopped working on the upgrade.

dhcpcd still works as far as I can tell when wpa_supplicant is run simultaneously, manually using the command line,

wpa_supplicant -i wlp3s0 -c /etc/wpa_supplicant.conf

but it has stopped running the hook /usr/lib/dhcpcd/dhcpcd-hooks/10-wpa_supplicant which I've installed with

ln -s /usr/share/dhcpcd/hooks/10-wpa_supplicant /usr/lib/dhcpcd/dhcpcd-hooks/

as the wiki suggests. I tried diffing the new and old versions of /usr/lib/dhcpcd/dhcpcd-run-hooks and /usr/lib/dhcpcd/dhcpcd-hooks/10-wpa_supplicant, but they appear to be the same.

My wpa_supplicant.conf, for reference is:

ctrl_interface=/var/run/wpa_supplicant
update_config=1

network={
        ssid="ssid1"
        psk="pass1"
}

network={
    ssid="ssid2"
    psk="pass2"
}

network={
    ssid="ssid3"
    pairwise=CCMP TKIP
    group=CCMP TKIP
    psk="pass3"
}

network={
    key_mgmt=NONE
    priority=-999
}

When run without wpa_supplicant, the new dhcpcd stalls at

wlp3s0: waiting for carrier

Should I treat this as an upstream bug, or have I missed some change in dhcpcd's directory structure?

Edit: Forgot to note that I downgraded it to the old version dhcpcd-9.1.1-1, which works, so it appears to be isolated to this package

Last edited by idlepork (2020-06-18 17:26:26)

Offline

#2 2020-06-19 11:00:26

Lone_Wolf
Member
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 11,866

Re: dhcpcd-9.1.2-1 isn't properly running wpa_supplicant hook

We need more info.

Please post a full journalctl -b from a boot where this failed.

For testing purpose disable any dhcpcd systemd services you have enabled , then reboot into multi-user.target* and run dhcpcd manually from CLI as root.
Post the cli output and journal of that boot .

NOTE : troubleshooting network issues can be very tricky, minimizing possible interference sources helps.

*
Incase you normally boot to a display manager, add systemd.unit=multi-user.target as kernel paramater to the boot  commandline .


Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.


(A works at time B)  && (time C > time B ) ≠  (A works at time C)

Offline

#3 2020-06-19 14:36:41

hpmachining
Member
From: Michigan
Registered: 2016-11-23
Posts: 40
Website

Re: dhcpcd-9.1.2-1 isn't properly running wpa_supplicant hook

I am having the same issue as OP. I thought I would pass along my information, as well. This is with disabling the service and starting dhcpcd manually.
journalctl -b

For me, it seems to be this commit that introduces the problem:
privsep: Implement a resource limited sandbox

I have also found that if I build 9.1.2 with --disable-privsep added to the configuration section in the PKGBUILD works, but I don't know the implications of disabling privileged separation. Just wanted to add the information.

Update: The following commit from yesterday fixes the problem for me.
EDIT: Removed link. Turns out it did not fix it for me. Sorry for the noise.

Last edited by hpmachining (2020-06-19 17:14:23)

Offline

#4 2020-06-20 10:58:27

Lone_Wolf
Member
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 11,866

Re: dhcpcd-9.1.2-1 isn't properly running wpa_supplicant hook

Thanks, hpmachining .

It does look like your system has an ethernet connection and a wireless one ?

The log suggests something goes wrong with both connections.

dhcpcd first detects a carrier on enp4s0f1 (eth0) , then loses it.
The kernel doesn't see  a link on enp4s0f1 at all.

wlan0 / wlp3s0 shows the same behavior, a carrier is detected then lost .

The aur dhcpcd-git pacakge doesn't build with privsep, would have to be updated so for now not useful .

hpmachining, This does look like an internal problem in dhcpcd code (probably related to hooks handling) and I do think the author needs to know this.

Maybe you could report this to the dhcpcd-discuss ML , https://roy.marples.name/projects/dhcpcd/#mailing-lists ?




Sidenote :
I use dhcpcd with only the default hooks and have no issues.


Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.


(A works at time B)  && (time C > time B ) ≠  (A works at time C)

Offline

#5 2020-06-20 12:27:41

hpmachining
Member
From: Michigan
Registered: 2016-11-23
Posts: 40
Website

Re: dhcpcd-9.1.2-1 isn't properly running wpa_supplicant hook

Thank you Lone_Wolf.

Lone_Wolf wrote:

It does look like your system has an ethernet connection and a wireless one ?

System has both but it was not plugged in to ethernet.

The aur dhcpcd-git pacakge doesn't build with privsep, would have to be updated so for now not useful .

I modified the trunk PKGBUILD to use git source for testing. As of yesterday I still had the issue with latest commit.

hpmachining, This does look like an internal problem in dhcpcd code (probably related to hooks handling) and I do think the author needs to know this.

Maybe you could report this to the dhcpcd-discuss ML , https://roy.marples.name/projects/dhcpcd/#mailing-lists ?

I’ll do that.

Offline

#6 2020-06-21 05:52:32

Vain
Member
Registered: 2008-10-19
Posts: 179
Website

Re: dhcpcd-9.1.2-1 isn't properly running wpa_supplicant hook

hpmachining, have you checked whether the wpa_supplicant hook runs at all? If it does, what's the value of `$ifwireless`? For me, it's 0, so the hook exits and does nothing. (So, yes, it appears I see the same issue.)

I don't see an email from you on the dhcpcd-discuss archive yet. If you have not yet sent your mail, could you check that variable and maybe include this bit of information in your upstream report?

Offline

#7 2020-06-21 16:39:35

hpmachining
Member
From: Michigan
Registered: 2016-11-23
Posts: 40
Website

Re: dhcpcd-9.1.2-1 isn't properly running wpa_supplicant hook

Thank you Vain, you're definitely on to something. Hook does run but ifwireless = 0, which causes it to exit without running the wpa_supplicant command. On working builds, ifwireless = 1 for the wireless interface. I will play around some more today and send my report upstream by end of day.

Offline

#8 2020-06-22 10:18:13

Mox
Member
Registered: 2012-02-07
Posts: 32

Re: dhcpcd-9.1.2-1 isn't properly running wpa_supplicant hook

Hey, I got to the same conclusion. But diff-ing the sources for 9.0.2 and 9.1.2 I did not reveal any relevant changes to me.
The env variable $ifwireless is set in script.c:354, depending on bool wireless in struct interface from dhcpcd.h.

In the current version, if.c:650 seems to be the only place where interface.wireless is set, in the 9.1.0 sources that is line 638. This reads

		if (if_getssid(ifp) != -1) {
			ifp->wireless = true;
			ifp->metric += 100;
		}

Of course, this excludes struct intitialisation by either memset() or initialisation lists. But searching this will take more time as I can not simply grep for this.

Offline

#9 2020-06-22 23:20:02

hpmachining
Member
From: Michigan
Registered: 2016-11-23
Posts: 40
Website

Re: dhcpcd-9.1.2-1 isn't properly running wpa_supplicant hook

Looks like this is fixed with this commit:
Linux: keep the generic netlink socket around to get ssid with privsep

This patch can be used on 9.1.2 to fix.

Upstream has limited ability to test wireless on Linux and would like help with testing.
Re: dhcpcd-9.1.2 wifi issue

Offline

Board footer

Powered by FluxBB