_GTK_ENCAP

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

TomDeMan

24-06-2008 09:09:50

I'm new here so be free to direct me to the right place for this if not appropriate

RT61 1.1.0-b2

in wpa.h it says

//802.11i D10 page 83
typedef struct _GTK_ENCAP {
#ifndef BIG_ENDIAN
UCHAR Kid2;
UCHAR tx1;
UCHAR rsv5;
UCHAR rsv1;
#else
UCHAR rsv5;
UCHAR tx1;
UCHAR Kid2;
UCHAR rsv1;
#endif
UCHAR GTK[32];
} GTK_ENCAP, *PGTK_ENCAP;

typedef struct _KDE_ENCAP {
UCHAR Type;
UCHAR Len;
UCHAR OUI[3];
UCHAR DataType;
GTK_ENCAP GTKEncap;
} KDE_ENCAP, *PKDE_ENCAP;


wpa.c says

if ((KeyDataLength >= 8) && (KeyDataLength <= sizeof(KDE_ENCAP))) {

Since sizeof() is used both structs should have the PACKED keyword in them or this won't work (everywhere) no ?

Vern

26-06-2008 17:15:20

Hi TomDeMan,

Nice to see you're looking at code. I'm afraid the betas are sadly out of date. You might try downloading and using the hourly tarballs, where you'll see that your observation has been implemented.

But not to worry, the legacy drivers provide fertile fields for bug hunting - er, I mean, seeking opportunities for enhanced functionality.

Thanks,

TomDeMan

10-07-2008 16:04:55

Wow, you're right that code is much much newer.

Found something strange in it too though

rtmp_info.c

Set_WPAPSK_Proc()

arg[strlen(arg)] = '\0';

This doesn't seem to make sense, either 'arg' is null terminated and it does nothing, or it isn't NULL terminated and then strlen will have trouble determining the size also...

Vern

10-07-2008 20:11:31

Hi TomDeMan,

I think you're right. Would you care to delete it, regress the modified driver, and - when all is AOK - post your results here, or submit it as a patch to the Sourceforge project?

Thanks,

TomDeMan

11-07-2008 15:53:28

Hi Vern,

I never did changes to sourceforge, I'm not even running linux now (still learning, first steps there). I'm just looking at how the driver was made to learn a few things from it (we will use the hardware in the future on our embedded board, but not in linux right away, maybe later).
Could you do those things for me ? Or do you know someone who wants to do that ?