The problem

A few month ago i bought an rt73-base usb wifi dongle to make a low-cost access-point from my old linux box. Unfortunately i couldn't make it work until last week, when i finally figured out the root of the problem. First of all, i used the latest rt2x00 development kernel (how to get it), and the latest hostapd from the git repository. The official howto on the rt2x00 wiki is quite good, but it didn't work with my TL-WN321G wifi dongle, so i had to find out what's the problem. First the hostapd started up, and the clients could associate, but when i tried to send packages, the hostapd dropped error messages in an infinite loop:

wlan0: STA 00:12:f0:76:03:b9 IEEE 802.11: association OK (aid 1)
MGMT (TX callback) fail
mgmt::assoc_resp cb
wlan0: STA 00:12:f0:76:03:b9 IEEE 802.11: did not acknowledge association
response
Sending disassociation info to STA 00:12:f0:76:03:b9
MGMT (TX callback) fail
unknown mgmt cb frame subtype 10

Investigation

And then it reassociates with the client, does it again and again. So after few days spent on trying to figure out what is the problem, i found some interesting posts on hostapd, and rt2x00 mailing lists on this topic. The most interesting is this thread. The discussion is about three patch, and the first one is the important one. They say, that the driver can not ackowledge the completion of sending certain frames, because of hardware limitations. So, the case is, that the driver can't acknowledge these frames, but the hostapd wants an acknowledgement, or it won't function function properly.

The possible solutions

There are two solutions.

  • Patch the driver to acknowledge the frames even if it is not sure that they have been succesfully sent.
  • Patch hostapd to ignore the lack of acknowledgement.

The second one seems to be the easier way, so i have chosen to patch hostapd.

Patching hostapd

You have to comment out two lines in the ieee802_11.c file. Search for "did not acknowledge" in the file, and comment out the "return;" command after the lines that contain the "did not acknowledge" string. So after commenting out the return lines, the two blocks look like this:

 if (!ok) {
   hostapd_logger(hapd, mgmt->da, HOSTAPD_MODULE_IEEE80211,
                  HOSTAPD_LEVEL_NOTICE,
                  "did not acknowledge authentication response");
   //return;
}

if (!ok) {
   hostapd_logger(hapd, mgmt->da, HOSTAPD_MODULE_IEEE80211,
                  HOSTAPD_LEVEL_DEBUG,
                  "did not acknowledge association response");
   //return;
}

As you can see, now the hostapd will write in the log that the acknowledgement wasn't received, but the association and authentication will continue as if nothing wrong had happened. After patching the source it works, like a charm :)

I hope you can use this guide, and won't have to google for days like i did...

A bejegyzés trackback címe:

https://eznemegy.blog.hu/api/trackback/id/tr36822079

Kommentek:

A hozzászólások a vonatkozó jogszabályok  értelmében felhasználói tartalomnak minősülnek, értük a szolgáltatás technikai  üzemeltetője semmilyen felelősséget nem vállal, azokat nem ellenőrzi. Kifogás esetén forduljon a blog szerkesztőjéhez. Részletek a  Felhasználási feltételekben és az adatvédelmi tájékoztatóban.

moli 2009.11.08. 00:46:24

Szia, segitseged kerem.
Van egy edimax ew-7318ug usb dongle wifi adapterem [elvileg RT73-as, ID 148f:2573 Ralink Technology, Corp. RT2501USB Wireless Adapter], melyet nem tudok master mode-ba (access point) tenni [SET failed on device wlan0 ; Invalid argument.] ubuntu 9.10 alatt.

ubuntu 9.04 alatt meg a driver se tudott elindulni, kezzel kellett forgatni, de meg ugy se sikerult. Most vegre elindul, infrastructure-ben csatlakozni is tudok akar wpa2-vel.
A neten mindent irnak, van aki azt, hogy a ralink usb adaptereket soha nem lehet majd master-be rakni, van aki azt, hogy neki sikerult, de vagy szakadozik (ack/fail, stb), vagy csak alacsony mtu-val, stb

Neked sikerult ezeket kikuszobolni? Hogy? Koszonom!

mg 2009.12.08. 15:41:56

Szia!

Öszintén szolva a post megirása utáni kezdeti lelkesedés után néhány nap alatt kiderült, hogy azért mégsem olyan jó az rt73 master-módban. Akadozik a hozzáférés wifi-n, bár ugyanez a gyenge gép a két vezetékes hálózati kártyája közötti switch-elést is ugyanilyen lassan csinálja, nem tudom mi lehet a gond :(

Azt javasolnám, 1. az rt2x00 levlista archivumban probalj keresni a problemara, lehet h irnak valamit rola, 2. git-en szerezd be az rt2x00 kernel-forrast (vagy lehet h talalsz tarolot, PPA-t hozza valahol), ebben olyan fejlesztések is vannak amit még nem tettek bele az aktuális kernel-kiadásba. Ha ezzel próbálkozol, és ugy sem megy, hát, akkor csak a driver-fejlesztők tudnak segíteni :( Ha a driver normálisan meg lenne csinálva, akkor elvileg baromi egyszerü lenne az a Master mode, dehát nincsenek megcsinálva.

Vagy esetleg lehet hogy a parancs amit kiadsz rossz, vagy rossz sorrendben irsz be valamit, ez esetben lehet h tudok segiteni, ha bemasolod hogyan probalkozol.

moli 2009.12.08. 20:28:51

@mg: szia, koszonom a valaszt, azota kolcsonkertem baratoktol egy osdi g-s routert, azt kotottem ra a sajat g-s routeremre :) igy jobb is, mert nem kell egy gepnek mennie, amikor szuksegem van a wep-es wifire, ugyanis a nintendo ds nem ismeri a wpa-t.
ugyanitt wifi dongle elado ;)

mg 2009.12.08. 21:07:47

@moli: OK, örülök h megoldodott :) Wifi dongle van nekem is :)

darkbraven 2009.12.30. 04:56:30

Hi there mg,
I messaged u something rgarding this post. I hoped it reached you, as the system didnt show whether it is sent or not...

If it didnt, please do reply here. I will post another one in this comment instead.

Thx!

mg 2009.12.30. 09:47:02

@darkbraven: Your message is in my inbox! I will reply as soon as i have a little free time, probably today.

Have a good day :)

airween 2010.03.15. 21:20:04

Hello,

sikerült esetleg előrelépni valamit ezen a téren? Nekem csont nélkül elindul, de random előjön egy hiba: disconnect után a kliens nem látja az AP-t - miközben más kliens még használja azt, de ha azt is lekapcsolódik, akkor onnantól az sem látja.
süti beállítások módosítása