Please note: This project is no longer active. The website is kept online for historic purposes only.
If you´re looking for a Linux driver for your Atheros WLAN device, you should continue here .

Ticket #552 (closed defect: fixed)

Opened 8 years ago

Last modified 4 years ago

hostapd 0.5.2 fails with recent versions of madwifi when encryption is disabled.

Reported by: rcastellucci@solisys.com Assigned to:
Priority: major Milestone:
Component: madwifi: tools Version:
Keywords: Cc:
Patch is attached: 0 Pending:

Description

I'm using hostapd 0.5.2 compiled with madwifi-ng r1475 on 2.6.15.6. I also tried r1518.

I get the following when I attempt ot that hostapd:

# hostapd -dddd /rw/etc/hostapd-ath0.conf
Configuration file: /rw/etc/hostapd-ath0.conf
madwifi_set_iface_flags: dev_up=0
Using interface ath0 with hwaddr 00:02:6f:20:fa:82 and ssid 'test-ath0'
SIOCGIWRANGE: WE(compiled)=19 WE(source)=13 enc_capa=0x0
Flushing old station entries
madwifi_sta_deauth: addr=ff:ff:ff:ff:ff:ff reason_code=3
ioctl[IEEE80211_IOCTL_SETMLME]: Invalid argument
Could not connect to kernel driver.
Deauthenticate all stations
madwifi_set_iface_flags: dev_up=0

I know I've got hostapd compiled against the madwifi drivers i'm using, and it is installed corectly as far as i can tell.

my config file

interface=ath0
driver=madwifi
logger_syslog=-1
logger_syslog_level=2
logger_stdout=-1
logger_stdout_level=2
debug=0
dump_file=/tmp/hostapd.dump
ssid=test-ath0
eapol_key_index_workaround=0
eap_server=0
own_ip_addr=127.0.0.1

strace output

# strace hostapd -dddd /rw/etc/hostapd-ath0.conf
execve("/usr/local/bin/hostapd", ["hostapd", "-dddd", "/rw/etc/hostapd-ath0.conf
"], [/* 13 vars */]) = 0
uname({sys="Linux", node="hotspot", ...}) = 0
brk(0)                                  = 0x808b000
old_mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0
xb7fa3000
access("/etc/ld.so.nohwcap", F_OK)      = -1 ENOENT (No such file or directory)
open("/etc/ld.so.preload", O_RDONLY)    = -1 ENOENT (No such file or directory)
open("/etc/ld.so.cache", O_RDONLY)      = 3
fstat64(3, {st_mode=S_IFREG|0644, st_size=6275, ...}) = 0
old_mmap(NULL, 6275, PROT_READ, MAP_PRIVATE, 3, 0) = 0xb7fa1000
close(3)                                = 0
access("/etc/ld.so.nohwcap", F_OK)      = -1 ENOENT (No such file or directory)
open("/usr/lib/i586/libssl.so.0.9.7", O_RDONLY) = 3
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0\0\205\0"..., 512) = 512
fstat64(3, {st_mode=S_IFREG|0644, st_size=182192, ...}) = 0
old_mmap(NULL, 182960, PROT_READ|PROT_EXEC, MAP_PRIVATE, 3, 0) = 0xb7f74000
old_mmap(0xb7f9e000, 12288, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED, 3, 0x2a
000) = 0xb7f9e000
close(3)                                = 0
access("/etc/ld.so.nohwcap", F_OK)      = -1 ENOENT (No such file or directory)
open("/usr/lib/i586/libcrypto.so.0.9.7", O_RDONLY) = 3
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0p\300\2"..., 512) = 512
fstat64(3, {st_mode=S_IFREG|0644, st_size=952744, ...}) = 0
old_mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0
xb7f73000
old_mmap(NULL, 970744, PROT_READ|PROT_EXEC, MAP_PRIVATE, 3, 0) = 0xb7e86000
old_mmap(0xb7f5e000, 73728, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED, 3, 0xd7
000) = 0xb7f5e000
old_mmap(0xb7f70000, 12280, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANON
YMOUS, -1, 0) = 0xb7f70000
close(3)                                = 0
access("/etc/ld.so.nohwcap", F_OK)      = -1 ENOENT (No such file or directory)
open("/lib/libc.so.6", O_RDONLY)        = 3
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0\360^\1"..., 512) = 512
fstat64(3, {st_mode=S_IFREG|0755, st_size=1244688, ...}) = 0
old_mmap(NULL, 1254852, PROT_READ|PROT_EXEC, MAP_PRIVATE, 3, 0) = 0xb7d53000
old_mmap(0xb7e7b000, 32768, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED, 3, 0x12
7000) = 0xb7e7b000
old_mmap(0xb7e83000, 9668, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONY
MOUS, -1, 0) = 0xb7e83000
close(3)                                = 0
access("/etc/ld.so.nohwcap", F_OK)      = -1 ENOENT (No such file or directory)
open("/lib/libdl.so.2", O_RDONLY)       = 3
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0p\34\0\000"..., 512) = 5
12
fstat64(3, {st_mode=S_IFREG|0644, st_size=9872, ...}) = 0
old_mmap(NULL, 8632, PROT_READ|PROT_EXEC, MAP_PRIVATE, 3, 0) = 0xb7d50000
old_mmap(0xb7d52000, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED, 3, 0x200
0) = 0xb7d52000
close(3)                                = 0
munmap(0xb7fa1000, 6275)                = 0
brk(0)                                  = 0x808b000
brk(0x80ac000)                          = 0x80ac000
brk(0)                                  = 0x80ac000
rt_sigaction(SIGHUP, {0x804d440, [HUP], SA_RESTART}, {SIG_DFL}, 8) = 0
rt_sigaction(SIGINT, {0x804d440, [INT], SA_RESTART}, {SIG_DFL}, 8) = 0
rt_sigaction(SIGTERM, {0x804d440, [TERM], SA_RESTART}, {SIG_DFL}, 8) = 0
rt_sigaction(SIGUSR1, {0x804d440, [USR1], SA_RESTART}, {SIG_DFL}, 8) = 0
fstat64(1, {st_mode=S_IFCHR|0600, st_rdev=makedev(4, 64), ...}) = 0
ioctl(1, SNDCTL_TMR_TIMEBASE or TCGETS, {B19200 opost isig icanon echo ...}) = 0
old_mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0
xb7fa2000
write(1, "Configuration file: /rw/etc/host"..., 46Configuration file: /rw/etc/ho
stapd-ath0.conf
) = 46
open("/rw/etc/hostapd-ath0.conf", O_RDONLY) = 3
fstat64(3, {st_mode=S_IFREG|0644, st_size=10893, ...}) = 0
old_mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0
xb7fa1000
read(3, "##### hostapd configuration file"..., 4096) = 4096
read(3, "and\n# concatenating these into o"..., 4096) = 4096
read(3, "is can be either entered as a 25"..., 4096) = 2701
read(3, "", 4096)                       = 0
close(3)                                = 0
munmap(0xb7fa1000, 4096)                = 0
socket(PF_INET, SOCK_DGRAM, IPPROTO_IP) = 3
ioctl(3, SIOCGIFINDEX, {8, "ath0"})     = 0
socket(PF_PACKET, SOCK_RAW, 36488)      = 4
ioctl(4, SIOCGIFINDEX, {8, "ath0"})     = 0
bind(4, {sa_family=AF_PACKET, proto=0x888e, if8, pkttype=PACKET_HOST, addr(0)={0
, }, 20) = 0
ioctl(4, SIOCGIFHWADDR, 0xbfab9420)     = 0
ioctl(3, SIOCSIWMODE, 0xbfab9490)       = 0
write(1, "madwifi_set_iface_flags: dev_up="..., 34madwifi_set_iface_flags: dev_u
p=0
) = 34
ioctl(3, SIOCGIFFLAGS, 0xbfab9420)      = 0
ioctl(3, SIOCSIFFLAGS, 0xbfab9420)      = 0
ioctl(3, SIOCGIWESSID, 0xbfab94b0)      = 0
write(1, "Using interface ath0 with hwaddr"..., 72Using interface ath0 with hwad
dr 00:02:6f:20:fa:82 and ssid 'test-ath0'
) = 72
gettimeofday({1143500214, 434222}, NULL) = 0
time(NULL)                              = 1143500214
ioctl(3, SIOCGIWRANGE, 0xbfab9480)      = 0
write(1, "SIOCGIWRANGE: WE(compiled)=19 WE"..., 57SIOCGIWRANGE: WE(compiled)=19
WE(source)=13 enc_capa=0x0
) = 57
socket(PF_NETLINK, SOCK_RAW, 0)         = 5
bind(5, {sa_family=AF_NETLINK, pid=0, groups=00000001}, 12) = 0
write(1, "Flushing old station entries\n", 29Flushing old station entries
) = 29
write(1, "madwifi_sta_deauth: addr=ff:ff:f"..., 57madwifi_sta_deauth: addr=ff:ff
:ff:ff:ff:ff reason_code=3
) = 57
ioctl(3, 0x8bf0, 0xbfab9400)            = -1 EINVAL (Invalid argument)
dup(2)                                  = 6
fcntl64(6, F_GETFL)                     = 0x8002 (flags O_RDWR|O_LARGEFILE)
fstat64(6, {st_mode=S_IFCHR|0600, st_rdev=makedev(4, 64), ...}) = 0
ioctl(6, SNDCTL_TMR_TIMEBASE or TCGETS, {B19200 opost isig icanon echo ...}) = 0
old_mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0
xb7fa1000
_llseek(6, 0, 0xbfab9280, SEEK_CUR)     = -1 ESPIPE (Illegal seek)
write(6, "ioctl[IEEE80211_IOCTL_SETMLME]: "..., 49ioctl[IEEE80211_IOCTL_SETMLME]
: Invalid argument
) = 49
close(6)                                = 0
munmap(0xb7fa1000, 4096)                = 0
write(1, "Could not connect to kernel driv"..., 36Could not connect to kernel dr
iver.
) = 36
write(1, "Deauthenticate all stations\n", 28Deauthenticate all stations
) = 28
close(0)                                = 0
close(5)                                = 0
write(1, "madwifi_set_iface_flags: dev_up="..., 34madwifi_set_iface_flags: dev_u
p=0
) = 34
ioctl(3, SIOCGIFFLAGS, 0xbfab95c0)      = 0
ioctl(3, SIOCSIFFLAGS, 0xbfab95c0)      = 0
close(3)                                = 0
close(4)                                = 0
munmap(0xb7fa2000, 4096)                = 0
exit_group(1)                           = ?

Change History

04/20/06 21:56:44 changed by anonymous

The problem seems to be that madwifi thinks the interface is down...

04/20/06 22:15:28 changed by anonymous

This is, in fact a bug in hostapd. hostapd takes the interface down when it starts up.

04/24/06 07:53:02 changed by dyqith

So, any updates on this issue ?

04/24/06 19:11:51 changed by rcastellucci@solisys.com

This issue is entirely hostapd's fault. This ticket should be closed as it's not a madwifi problem.

04/24/06 19:16:56 changed by dyqith

  • status changed from new to closed.
  • resolution set to fixed.

Okay, I'm closing the ticket, please feel free to re-open if found otherwise.

05/13/06 04:11:10 changed by BrainSlayer

  • status changed from closed to reopened.
  • component changed from madwifi: tools to madwifi: 802.11 stack.
  • resolution deleted.

i totally disagree. it looks like a problem within the net80211 stack. hostapd is unable to retrieve the rsn_ie field or in other words it is returned as empty and is zero. which will result in messages like No WPA/RSN information element for station or WPA/RSN information element rejected. everything looks like net80211 IOCTL_GETWPAIE is not working correctly as it should

05/13/06 04:15:37 changed by anonymous

to make reproducing a little bit easier

use the following configurations for testing. note that this only happends in wpa2/psk2 mode.

hostapd.conf:

interface=ath0 bridge=br0 driver=madwifi logger_syslog=-1 logger_syslog_level=2 logger_stdout=-1 logger_stdout_level=2 debug=0 dump_file=/tmp/hostapd.dump eapol_key_index_workaround=0 wpa=2 wpa_passphrase=123456789 wpa_key_mgmt=WPA-PSK wpa_pairwise=CCMP wpa_group_rekey=

wpa_supplicant.conf

ap_scan=1 fast_reauth=1 eapol_version=1 ctrl_interface_group=0 ctrl_interface=/var/run/wpa_supplicant network={

ssid="default" scan_ssid=1 key_mgmt=WPA-PSK pairwise=CCMP group=CCMP proto=RSN psk="123456789"

}

05/13/06 05:29:55 changed by mentor

Is this exactly the same issue as you are experiencing? This one is related to the fact that hostapd does not set the madwifi interface to up when there is no encryption enabled.

05/14/06 22:05:33 changed by anonymous

it could. i just see the symptom since many days/weeks and i saw no other here with such problems. since i'm not the only one in our dev team with this problem it was time todo something. the hostapd developers commented the bug with a problem in madwifi and not hostapd and madwifi does the total opposite.

05/14/06 22:59:24 changed by rcastellucci@solisys.com

  • component changed from madwifi: 802.11 stack to madwifi: tools.
  • summary changed from hostapd 0.5.2 fails with recent versions of madwifi to hostapd 0.5.2 fails with recent versions of madwifi when encryption is disabled..

the problem this ticket was far is 100% hostapd's fault. hostapd disables the interface, and does not bring it back up unless encryption is turned on. I read the source to verify this. The followup on this ticket is a diffrent issue, and should be moved to a new ticket.

05/15/06 15:14:52 changed by anonymous

this is not true. we modified hostapd to stay away from setting the interface to down. it still remains at the same error

05/17/06 11:18:52 changed by anonymous

very fun discussion:) I bet for hostap team!

08/24/06 20:08:13 changed by anonymous

I am trying to solve this same problem. I have the latest SVN of both the madwifi and hostapd, and encounter this same error. I have attempted several versions of both as well. Any ideas are welcomed. If I set any encryption, hostapd comes up just fine. Very, very frustrating.

Thanks!

08/25/06 00:13:49 changed by matth

what about having a driver independant set_iface_flags in hostapd.c that'll put the inteface up after initial setup ?

for now that problem can be workarounded doing silly stuff like

.config:

ifdef CONFIG_NO_AUTH
CFLAGS += -DCONFIG_NO_AUTH
CONFIG_NO_AUTH=y
endif

driver_madwifi.c:1206

madwifi_set_iface_flags(drv, 0);      /* mark down during setup */
#ifdef CONFIG_NO_AUTH
	madwifi_set_iface_flags(drv, 1);

and in .config add a :

CONFIG_NO_AUTH=y

09/15/06 04:23:25 changed by mrenzmann

Quoting a mail from Jouni on the hostap mailing list:

The plaintext mode is not working with the current hostapd version. The driver interface for madwifi was designed with the view of no one using hostapd in case of plaintext mode (which is something I do not agree with) and because of this, only the WPA (and maybe non-WPA IEEE 802.1X) modes set up the driver properly.

10/16/06 04:06:16 changed by jkmaline@cc.hut.fi

I added support for configuring unencrypted modes (both plaintext and IEEE 802.1X without encryption) into driver_madwifi.c in hostapd (in current 0.5.x development branch). With these changes, I was able to test all modes successfully with madwifi v0.9.2, i.e., plaintext, IEEE 802.1X without WEP, IEEE 802.1X with WEP, WPA-PSK, WPA-EAP, WPA2-PSK, WPA2-EAP, WPA+WPA2.

11/26/07 06:53:52 changed by mtaylor

  • status changed from reopened to closed.
  • resolution set to fixed.

04/06/10 11:23:00 changed by anonymous

I am getting the following error messages when i tried WLAN

~/wlanexe # ./hostapd -dddd /etc/hostapd.conf Configuration file: /etc/hostapd.conf TLS: Trusted root certificate(s) loaded madwifi_set_iface_flags: dev_up=0 madwifi_set_privacy: enabled=0 BSS count 1, BSSID mask ff:ff:ff:ff:ff:ff (0 bits) Flushing old station entries madwifi_sta_deauth: addr=ff:ff:ff:ff:ff:ff reason_code=3 ioctl[IEEE80211_IOCTL_SETMLME]: Invalid argument madwifi_sta_deauth: Failed to deauth STA (addr ff:ff:ff:ff:ff:ff reason 3) Could not connect to kernel driver. Deauthenticate all stations madwifi_sta_deauth: addr=ff:ff:ff:ff:ff:ff reason_code=2 ioctl[IEEE80211_IOCTL_SETMLME]: Invalid argument madwifi_sta_deauth: Failed to deauth STA (addr ff:ff:ff:ff:ff:ff reason 2) madwifi_set_privacy: enabled=0 madwifi_del_key: addr=00:00:00:00:00:00 key_idx=0 madwifi_del_key: addr=00:00:00:00:00:00 key_idx=1 madwifi_del_key: addr=00:00:00:00:00:00 key_idx=2 madwifi_del_key: addr=00:00:00:00:00:00 key_idx=3 Using interface ath0 with hwaddr 00:0b:6b:33:8c:30 and ssid 'RenjithGwpa?' SSID - hexdump_ascii(len=11):

52 65 6e 6a 69 74 68 47 77 70 61 RenjithGwpa?

PSK (ASCII passphrase) - hexdump_ascii(len=12):

6d 79 70 61 73 73 70 68 72 61 73 65 mypassphrase

PSK (from passphrase) - hexdump(len=32): a6 55 3e 76 94 8b d9 81 a1 22 5e 24 29 83 33 86 11 a8 7e 93 19 7c a9 ab ab cc 12 58 37 e5 35 b6 RADIUS local address: 172.16.25.1:1024 madwifi_set_ieee8021x: enabled=1 madwifi_configure_wpa: group key cipher=1 madwifi_configure_wpa: pairwise key ciphers=0xa madwifi_configure_wpa: key management algorithms=0x1 madwifi_configure_wpa: rsn capabilities=0x0 madwifi_configure_wpa: enable WPA=0x1 WPA: group state machine entering state GTK_INIT (VLAN-ID 0) GMK - hexdump(len=32): [REMOVED] GTK - hexdump(len=32): [REMOVED] WPA: group state machine entering state SETKEYSDONE (VLAN-ID 0) madwifi_set_key: alg=TKIP addr=00:00:00:00:00:00 key_idx=1 madwifi_set_privacy: enabled=1 madwifi_set_iface_flags: dev_up=1 ath0: Setup of interface done. l2_packet_receive - recvfrom: Network is down Wireless event: cmd=0x8c03 len=20

New STA

ioctl[unknown???]: Invalid argument madwifi_process_wpa_ie: Failed to get WPA/RSN IE Failed to get WPA/RSN information element. Data frame from not associated STA 00:0a:78:a0:0b:09

Any idea?