# wpa_supplicant ioctl[SIOCSIWPMKSA]

## sommersg

Hey, i saw another psot on this forum related to this but it wasn't resolved (and it was a bit different). Basically, when i startup my wireless which is configured with wpa_supplicant, i get an error like the following:

```

*   Starting wpa_supplicant on wlan0 ...

ioctl[SIOCSIWPMKSA]: Invalid argument

*   Waiting for association                                             [ok]

```

It ends up working fine though. But what's this error thing?

My /etc/conf.d/net looks like:

```

config_wlan0=( "dhcp" )

modules=( "wpa_supplicant" )

wpa_supplicant_wlan0="-Dndiswrapper"

wpa_timeout_wlan0=60

```

and my /etc/wpa_supplicant.conf

```

ctrl_interface=/var/run/wpa_supplicant

ctrl_interface_group=wheel

fast_reauth=1 << can someone tell me what this does actually?? >>

#home network

network={

    ssid="netname"

    proto=WPA

    key_mgmt=WPA-PSK

    priority=5

    psk="kentdeso"

}

```

So... any idea's what the issue is? Thanks.

----------

## wynn

Googling shows many questions but no answers.

Looking through the code (wireless_copy.h)

```
/* WPA2 : PMKSA cache management */

#define SIOCSIWPMKSA   0x8B36      /* PMKSA cache operation */
```

and where it is used (wpa_driver_wext_pmksa in driver_wext.c)

```
   if (ioctl(drv->ioctl_sock, SIOCSIWPMKSA, &iwr) < 0) {

      if (errno != EOPNOTSUPP)

         perror("ioctl[SIOCSIWPMKSA]");

      ret = -1;

   }
```

The routine wpa_driver_wext_pmksa tries to set it up and, if the driver doesn't return OK or say it doesn't support it, tells you.

If it works then it is probably a bug in the driver which should return "unsupported" but doesn't.

----------

## sommersg

Well i just realized it doesn't really work completely. Links worked so i think the internet was ok, and it did get an ip from my router, but at the same time it failed to sync the time using ntp-client when on wireless (worked fine on wired).

----------

## wynn

ntp-client appears to run ntpdate (/etc/conf.d/ntp-client) and it has a setting

```
# How long to wait (in seconds) before giving up.

# Useful for when you boot and DNS/internet isn't

# really available but you have your net interface

# come up with say a static IP.

NTPCLIENT_TIMEOUT=30
```

If things aren't ready, then it may timeout.

It might be worthwhile putting

```
/etc/init.d/ntp-client start
```

in /etc/conf.d/local.start and removing it from the default runlevel. This way, the Intenet/DNS may have stabilized by the time it gets called.

----------

## sommersg

I thought it was related to that at first too, but i tried syncing it manually (" % /etc/init.d/ntp-client start") wayyy after the wireless was up and it failed anyway. I think we should just assume the wireless doesn't work for the moment. Are there any known errors with ndiswrapper, raling rt2500's, and/or wpa_supplicant? I could try to set up the wirelress using iwconfig too i guess; i tried that earlier but couldn't get it working at all, presumably because i didnt know what i was doing, but i guess it couldve been for similar reasons as to why this isnt working.

----------

## wynn

 *Quote:*   

> Are there any known errors with ndiswrapper, raling rt2500's, and/or wpa_supplicant?

 In another thread, the poster was using the rt2500 driver but the lspci output showed it was

```
00:09.0 Network controller: RaLink RT2561/RT61 802.11g PCI 
```

and the rt61pci module worked.

What does lspci say about your card?

 *Quote:*   

> 
> 
> ```
> config_wlan0=( "dhcp" )
> ```
> ...

 Another problem was that the card's device was ra0 not wlan0, can you look in /var/log/messages or run dmesg and see what device name the kernel comes up with?

----------

## jammin

Hi, im very much a newbie, but try -

```

wpa_supplicant_wlan0="-Dwext -iwlan0 c=/etc/wpa_supplicant.conf"

```

I remember reading that more recent versions of wpa_supplicant do not support -Dndiswrapper and that if your using ndiswrapper to use -Dwext;

Here is my /etc/conf.d/net -

```

modules=( "wpa_supplicant" )

wpa_supplicant_wlan0="-Dwext -iwlan0 c=/etc/wpa_supplicant.conf"

config_wlan0=( "dhcp" )

dhcpd_wlan0=" -t 10"

```

And my etc/wpa_supplicant.conf

```

ctrl_interface=/var/run/wpa_supplicant

ctrl_interface_group=0

ap_scan=1

network={

 ssid="WorRouter"

 scan_ssid=1

 proto=WPA

 key_mgmt=WPA-PSK

 psk="XXXXXXX"

}

```

Which works fine, from boot, thanks to UberLord and others in a thread on these forums.

Hope this helps

----------

## wynn

 *Quote:*   

> 
> 
> ```
> wpa_supplicant_wlan0="-Dwext -iwlan0 c=/etc/wpa_supplicant.conf"
> ```
> ...

 I think it should be

```
wpa_supplicant_wlan0="-Dwext -iwlan0 -c/etc/wpa_supplicant.conf"
```

 "-c/etc" instead of "c=/etc".

----------

## sommersg

Ok thanks guys. I'll give it a try and report back.

----------

