Legacy RT73 Oops bug (with patch!)

Live forum: http://rt2x00.serialmonkey.com/viewtopic.php?t=5014

avl

26-09-2008 07:51:16

Whenever I try and set essid using the legacy RT73 driver (CVS version, fetched 25th september 2008), I get a kernel oops.

After some digging in the source code, I found a trivial (but deadly) error. In the file sync.c, in the function PeerProbeReqAction, in the first call to MakeOutgoingFrame, I found the following code

[codekap2qzvr]
MakeOutgoingFrame(pOutBuffer, &FrameLen,
sizeof(HEADER_802_11), &ProbeRspHdr,
TIMESTAMP_LEN, &FakeTimestamp,
2, BeaconPeriod,
2, &CapabilityInfo,
1, &SsidIe,
[/codekap2qzvr]

However, it almost certainly should be

[codekap2qzvr]
MakeOutgoingFrame(pOutBuffer, &FrameLen,
sizeof(HEADER_802_11), &ProbeRspHdr,
TIMESTAMP_LEN, &FakeTimestamp,
2, &BeaconPeriod, /*<- Note '&' before BeaconPeriod*/
2, &CapabilityInfo,
1, &SsidIe,
[/codekap2qzvr]

Hope this helps someone out there! And a big "thank you" to the people behind the serialmonkey project for hosting the drivers, this forum and everything!



Here is my attempt at using diff to create a patch
[codekap2qzvr]
diff -crB Module/sync.c Module.new/sync.c
*** Module/sync.c 2008-07-23 03:51:43.000000000 +0200
--- Module.new/sync.c 2008-09-26 09:42:06.000000000 +0200
***************
*** 1137,1143 ****
MakeOutgoingFrame(pOutBuffer, &FrameLen,
sizeof(HEADER_802_11), &ProbeRspHdr,
TIMESTAMP_LEN, &FakeTimestamp,
! 2, BeaconPeriod,
2, &CapabilityInfo,
1, &SsidIe,
1, &pAd->PortCfg.SsidLen,
--- 1137,1143 ----
MakeOutgoingFrame(pOutBuffer, &FrameLen,
sizeof(HEADER_802_11), &ProbeRspHdr,
TIMESTAMP_LEN, &FakeTimestamp,
! 2, &BeaconPeriod,
2, &CapabilityInfo,
1, &SsidIe,
1, &pAd->PortCfg.SsidLen,

[/codekap2qzvr]

Vern

26-09-2008 15:54:24

Hi avl,

Nice catch. Have you tested it? To generate a patch file, you can do this[code141p7j5j]diff -crB Module/sync.c Module.new/sync.c|zcat >sync.patch.gz[/code141p7j5j]then attach the patch file to a posting here.

Thanks again,

avl

28-09-2008 21:04:21

Hello,

Yes, I've tested it, and it appears to work. Will upload the patch here when I get back to work tomorrow.

avl

30-09-2008 06:48:46

Here is the patch, as promised


I created it by running

[code2ke38vpr]
diff -crB Module/sync.c Module.new/sync.c|gzip >sync.patch.gz
[/code2ke38vpr]

Vern

06-10-2008 16:24:31

Hi avl,

In CVS. Thanks.