Subject: wpa_supplicant endian issue
To: None <tech-net@netbsd.org>
From: Sean Boudreau <seanb@qnx.com>
List: tech-net
Date: 04/25/2007 09:43:34
Hi:

I was unable to get authenticated on a big endian
machine.  Turns out the receive sequence counter
is little endian on the wire.  Are there any objections
to the following before I commit?

Regards,

-seanb


Index: driver_netbsd.c
===================================================================
RCS file: /cvsroot/src/usr.sbin/wpa/wpa_supplicant/driver_netbsd.c,v
retrieving revision 1.1
diff -c -r1.1 driver_netbsd.c
*** driver_netbsd.c	1 Oct 2005 18:50:12 -0000	1.1
--- driver_netbsd.c	25 Apr 2007 13:04:55 -0000
***************
*** 341,346 ****
--- 341,347 ----
  		wk.ik_keyix = IEEE80211_KEYIX_NONE;
  	wk.ik_keylen = key_len;
  	memcpy(&wk.ik_keyrsc, seq, seq_len);
+ 	wk.ik_keyrsc = le64toh(wk.ik_keyrsc);
  	memcpy(wk.ik_keydata, key, key_len);
  
  	return set80211var(drv, IEEE80211_IOC_WPAKEY, &wk, sizeof(wk));