# wpa_supplicant: ioctl[IEEE80211_IOCTL_SETMLME]: Invalid argu

## bheinze

Hi,

I'm getting a strange error using madwifi-ng-0.92 and wpa_supplicant-0.5.4 when I try to connect to an AP.

ioctl[IEEE80211_IOCTL_SETMLME]: Invalid argument

Strangely I cannot find any other comments on this error in the forum here, although there a quite a number of people using madwifi and wpa_supp. I found some reports on this error in the internet, but no real solution.

Has anybody an idea what I'm doing wrong?

```
thinkpad tmp # wlanconfig ath0 create wlandev wifi0 wlanmode sta

ath0

thinkpad ~ # wpa_supplicant -Dmadwifi -iath0 -c/etc/wpa_supplicant.conf -d

Initializing interface 'ath0' conf '/etc/wpa_supplicant.conf' driver 'madwifi' ctrl_interface 'N/A' bridge 'N/A'

Configuration file '/etc/wpa_supplicant.conf' -> '/etc/wpa_supplicant.conf'

Reading configuration file '/etc/wpa_supplicant.conf'

ctrl_interface='/var/run/wpa_supplicant'

ctrl_interface_group=10

opensc_engine_path='/usr/lib/opensc/engine_opensc.so'

pkcs11_engine_path='/usr/lib/opensc/engine_pkcs11.so'

pkcs11_module_path='/usr/lib/pkcs11/opensc-pkcs11.so'

update_config=1

Priority group 0

   id=0 ssid='my university'

Initializing interface (2) 'ath0'

EAPOL: SUPP_PAE entering state DISCONNECTED

EAPOL: KEY_RX entering state NO_KEY_RECEIVE

EAPOL: SUPP_BE entering state INITIALIZE

EAP: EAP entering state DISABLED

EAPOL: External notification - portEnabled=0

EAPOL: External notification - portValid=0

SIOCGIWRANGE: WE(compiled)=20 WE(source)=13 enc_capa=0xf

  capabilities: key_mgmt 0xf enc 0xf

WEXT: Operstate: linkmode=1, operstate=5

Own MAC address: 00:14:a4:43:79:84

wpa_driver_madwifi_del_key: keyidx=0

wpa_driver_madwifi_del_key: keyidx=1

wpa_driver_madwifi_del_key: keyidx=2

wpa_driver_madwifi_del_key: keyidx=3

wpa_driver_madwifi_set_countermeasures: enabled=0

wpa_driver_madwifi_set_drop_unencrypted: enabled=1

Setting scan request: 0 sec 100000 usec

Added interface ath0

Wireless event: cmd=0x8b06 len=8

Ignore event for foreign ifindex 6

RTM_NEWLINK, IFLA_IFNAME: Interface 'ath0' added

RTM_NEWLINK, IFLA_IFNAME: Interface 'ath0' added

State: DISCONNECTED -> SCANNING

Starting AP scan (broadcast SSID)

Trying to get current scan results first without requesting a new scan to speed up initial association

Received 1182 bytes of scan results (6 BSSes)

Scan results: 6

Selecting BSS from priority group 0

0: 00:13:10:0a:db:d5 ssid='' wpa_ie_len=0 rsn_ie_len=22 caps=0x11

   skip - SSID mismatch

1: 00:13:49:9a:16:d8 ssid='XXX' wpa_ie_len=24 rsn_ie_len=0 caps=0x11

   skip - SSID mismatch

2: 00:16:38:71:a7:31 ssid='' wpa_ie_len=0 rsn_ie_len=0 caps=0x11

   skip - no WPA/RSN IE

3: 00:0f:66:97:de:d2 ssid='YYY' wpa_ie_len=0 rsn_ie_len=0 caps=0x1

   skip - no WPA/RSN IE

4: 00:0f:66:d3:0a:76 ssid='my university' wpa_ie_len=0 rsn_ie_len=0 caps=0x1

   skip - no WPA/RSN IE

5: 00:30:f1:9d:39:d4 ssid='WLAN' wpa_ie_len=0 rsn_ie_len=0 caps=0x1

   skip - no WPA/RSN IE

   selected non-WPA AP 00:0f:66:d3:0a:76 ssid='my university'

Trying to associate with 00:0f:66:d3:0a:76 (SSID='my university' freq=2417 MHz)

Cancelling scan request

WPA: clearing own WPA/RSN IE

Automatic auth_alg selection: 0x1

WPA: clearing AP WPA IE

WPA: clearing AP RSN IE

WPA: clearing own WPA/RSN IE

No keys have been configured - skip key clearing

wpa_driver_madwifi_set_drop_unencrypted: enabled=0

State: SCANNING -> ASSOCIATING

WEXT: Operstate: linkmode=-1, operstate=5

wpa_driver_madwifi_associate

######## HERE BE ERROR #####################################

ioctl[IEEE80211_IOCTL_SETMLME]: Invalid argument

Association request to the driver failed

######## HERE BE ERROR #####################################

```

wpa_supplicant.conf

```
ctrl_interface=/var/run/wpa_supplicant

ctrl_interface_group=10

opensc_engine_path=/usr/lib/opensc/engine_opensc.so

pkcs11_engine_path=/usr/lib/opensc/engine_pkcs11.so

pkcs11_module_path=/usr/lib/pkcs11/opensc-pkcs11.so

update_config=1

network={

        ssid="my university"

        key_mgmt=NONE

}
```

----------

## 96140

You've got a lot of SSID mismatch-type errors in your output. Triple-check the SSID you're trying to connect to. Make sure you spelled it right!

----------

## bheinze

The SSID mismatches occur only on access points named '' and 'XXX', so this is correct. However the other access points are skipped because of "no WPA/RSN IE", also the one of my university. Don't know why.

However after skipping all of the APs wpa_supplicant correctly tries to connect to the AP of my university

```
   selected non-WPA AP 00:0f:66:d3:0a:76 ssid='my university'

Trying to associate with 00:0f:66:d3:0a:76 (SSID='my university' freq=2417 MHz)
```

But fails later with

```
ioctl[IEEE80211_IOCTL_SETMLME]: Invalid argument

Association request to the driver failed 
```

----------

## schitthoch3

 *Quote:*   

> ioctl[IEEE80211_IOCTL_SETMLME]: Invalid argument Association request to the driver failed 

 

i have the same issue with latest stable packages (did a -uDN world today)

/etc/conf.d/net

```

############## ETHERNET HOME

config_eth0=( "192.168.2.123 netmask 255.255.255.0 brd 192.168.2.255" )

routes_eth0=( "default gw 192.168.2.1" )

############## WLAN

modules=( "wpa_supplicant" "!iwconfig" )

wpa_supplicant_ath0="-Dmadwifi"

# If i would use only one AP (at home, tried with this already)

#config_ath0=( "192.168.2.122 netmask 255.255.255.0 brd 192.168.2.255" )

#routes_ath0=( "default gw 192.168.2.1" )

# But i want to connect to different AP's in different locations (see wpa_supplicant.conf), therefore i use for WLAN @home

config_MyHomeEssid=( "192.168.2.122 netmask 255.255.255.0 brd 192.168.2.255" )

routes_MyHomeEssid=( "default gw 192.168.2.1" )

dns_servers_MyHomeEssid=( "192.168.2.1" )

```

/etc/wpa_supplicant.conf

```

ctrl_interface=/var/run/wpa_supplicant

ctrl_interface_group=0

eapol_version=1

ap_scan=1

fast_reauth=1

update_config=0 #overwrite config with gui ? (1=yes)

network={

        ssid="MyHomeEssid"

        key_mgmt=WPA-PSK

        proto=WPA

        pairwise=TKIP

        group=TKIP

        psk="Keyword"

#       psk=CryptedKeyword

}

network={

         ssid="public"

         key_mgmt=NONE

}

network={

        ssid="university"

        key_mgmt=WPA-EAP

        eap=TTLS

        pairwise=CCMP TKIP

        group=CCMP TKIP

        phase2="auth=MSCHAPV2"

        identity="myuser"

        password="mypass"

        priority=5

}

```

```

#stopping ethernet interface

/etc/init.d/net.eth0 stop

# starting wlan

/etc/init.d/net.ath0 start

 * Starting ath0

 *   Starting wpa_supplicant on ath0 ...                                                                                           [ ok ]

 *   Starting wpa_cli on ath0 ...                                                                                                  [ ok ]

 *     Backgrounding ...

# list interface configuration

...

ath0      Protokoll:Ethernet  Hardware Adresse 00:05:4E:4B:9F:1D

          UP BROADCAST MULTICAST  MTU:1500  Metric:1

          RX packets:20 errors:0 dropped:0 overruns:0 frame:0

          TX packets:18 errors:0 dropped:0 overruns:0 carrier:0

          Kollisionen:0 Sendewarteschlangenlänge:0

          RX bytes:2470 (2.4 Kb)  TX bytes:2202 (2.1 Kb)

...

```

so apparently my configuration from /etc/conf.d/net is not applied to ath0

next try

```

# killall wpa_supplicant

# wpa_supplicant -Dmadwifi -iath0 -c/etc/wpa_supplicant.conf

Trying to associate with 00:04:e2:d4:2d:88 (SSID='MyHomeEssid' freq=2462 MHz)

ioctl[IEEE80211_IOCTL_SETMLME]: Invalid argument

Association request to the driver failed

Associated with 00:04:e2:d4:2d:88

CTRL-EVENT-DISCONNECTED - Disconnect event - remove keys

Authentication with 00:00:00:00:00:00 timed out.

Trying to associate with 00:04:e2:d4:2d:88 (SSID='MyHomeEssid' freq=2462 MHz)

ioctl[IEEE80211_IOCTL_SETMLME]: Invalid argument

Association request to the driver failed

Associated with 00:04:e2:d4:2d:88

CTRL-EVENT-DISCONNECTED - Disconnect event - remove keys

```

I also tried to use wpa_supplicant_gui, but i can't choose an interface, it's blanked out ...

Kernel should be OK and loaded modules should be OK (quite everything is loaded for now)

any hints please ... i need wireless

----------

## schitthoch3

https://forums.gentoo.org/viewtopic-t-509135-highlight-.html

----------

