# [SOLVED] DHCPCD + wpa_supplicant without WEXT

## charles17

After first problems with dhcpcd are solved I am starting this new thread as the next problem is with wpa_supplicant.  I am using dhcpcd-9999 as network manager instead of netifrc and I finally removed wext support from my kernel as described in this post.

Now the wireless has a problem since wpa_supplicant can no longer connect to the access point. It turned out that I had to add one more parameter "ap_scan=2" in the head of the configuration file but that's only one step closer to the solution.  Next step, I had to learn how to debug wpa_supplicant and, 

here comes the error log in pastebin.

In it I can read *Quote:*   

> EAP: EAP entering state DISABLED
> 
> EAPOL: Supplicant port status: Unauthorized

 

But what does that mean, what is wrong here? I have no clue  :Sad: 

EDIT

Subject changedLast edited by charles17 on Tue Sep 16, 2014 9:49 am; edited 5 times in total

----------

## umka69

It seems that you need to enable WEXT in your kernel.

http://wiki.gentoo.org/wiki/Wifi

----------

## charles17

 *umka69 wrote:*   

> It seems that you need to enable WEXT in your kernel.
> 
> http://wiki.gentoo.org/wiki/Wifi

 I intentionally removed wext because according to UberLord's posting it should work without.

Today I cross checked debugging of wpa_supplicant once with wext enabled in the kernel (gentoo-sources:3.14.14) and once without. 

Comparing the debug logs may take us one step closer to the root cause of the problem.  I've put the diff in pastebin.

It looks like something called RTM_NEWLINK goes wrong and only can add the interface with CONFIG_NL80211_WEXT=y in the kernel.

 *Quote:*   

> RTM_NEWLINK, IFLA_IFNAME: Interface 'wlp8s0' added

 RTM_NEWLINK is mentioned in man rtnetlink, but not easy to understand.

Any idea?Last edited by charles17 on Sat Sep 13, 2014 5:42 pm; edited 1 time in total

----------

## umka69

Show your wpa_supplicant.conf please.

----------

## charles17

 *umka69 wrote:*   

> Show your wpa_supplicant.config please.

 Did you mean this file?  *Quote:*   

> /etc/wpa_supplicant_wpa_supplicant.conf

  *Quote:*   

> ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=wheel
> 
> # eapol_version=2
> 
> ap_scan=2
> ...

 What do you think should I put there?

Just to make it clear, this topic is about using dhcpcd as network manager in a pure mac80211 kernel without the old wireless extensions compatibility.

----------

## UberLord

Maybe you need to enable the nl80211 driver in wpa supplicant.

----------

## charles17

 *UberLord wrote:*   

> Maybe you need to enable the nl80211 driver in wpa supplicant.

 

From the debug log I can see the driver being ok:

 *Quote:*   

> wpa_supplicant v2.0
> 
> random: Trying to read entropy from /dev/random
> 
> Successfully initialized wpa_supplicant
> ...

 

----------

## UberLord

http://roy.marples.name/projects/dhcpcd/ci/3815155e933d566f03cb369e669ed7b9389cb480?sbs=0

After that patch I needed to add this to dhcpcd.conf

```
env wpa_supplicant_driver=nl80211
```

To get it to work. Without that, I had the same issues you did with WEXT disabled.

I think that's a bug with wpa_supplicant.

In summary, dhcpcd fully works with WEXT disabled now  :Smile: 

----------

## charles17

 *UberLord wrote:*   

> I think that's a bug with wpa_supplicant.

 Upstream? Cannot find an upstream bugtracker to report there  :Sad: 

 *UberLord wrote:*   

> In summary, dhcpcd fully works with WEXT disabled now 

 

That's really great!! I have tested and it also works for me.

P.S.:

Regression test with kernel still having wext enabled also works.

----------

## UberLord

Last I checked, upstream just had mailing lists.

Tell them that the driver should test nl80211 first and if that fails drop back to WEXT.

----------

## charles17

 *UberLord wrote:*   

> http://roy.marples.name/projects/dhcpcd/ci/3815155e933d566f03cb369e669ed7b9389cb480?sbs=0
> 
> After that patch I needed to add this to dhcpcd.conf
> 
> ```
> ...

 That looks equivalent to netifrc having that certain line in the config file as recommended in http://wiki.gentoo.org/wiki/Wpa_supplicant#Setup_with_netifrc_as_network_manager

One more thing

On the comparison table in http://wiki.gentoo.org/wiki/Network_management I have added that line for DHCPCD. May I ask you to care for or just comment on those question marks I've left there behind?

----------

## UberLord

Done.

Now, if someone could create a dhcpcd-ui project page as I suck @ wiki text  :Smile: 

It has a GTK+ front-end, the QT port is almost complete and has an applet just for systemd so applications can depend on dhcpcd saying "network ready".

http://roy.marples.name/projects/dhcpcd-ui

----------

## charles17

 *UberLord wrote:*   

> Last I checked, upstream just had mailing lists.
> 
> Tell them that the driver should test nl80211 first and if that fails drop back to WEXT.

 

According to http://w1.fi/cgit/hostap/plain/wpa_supplicant/ChangeLog that might already work in a newer version.  In case that really works your workaround in 10-wpa_supplicant were no longer needed.

```
   * changed the default driver interface from wext to nl80211 if both are

     included in the build
```

My version is the presently stable wpa_supplicant-2.0-r2.  Did you test with the newer version?

----------

## UberLord

No, I'm mainly running stable.

----------

## charles17

 *UberLord wrote:*   

> No, I'm mainly running stable.

 So do I, only some few packages with ~amd64.

Regarding the fix in wpa_supplicant, I've upgraded to wpa_supplicant-2.2.-r1 and locally redid your changes from http://roy.marples.name/projects/dhcpcd/info/3815155e933d566f03cb369e669ed7b9389cb480 and after rebooting it still works.   :Very Happy: 

----------

