3 May 2007 23:25
Re: wpa_supplicant endian issue
Pavel Cahyna <pavel <at> NetBSD.org>
2007-05-03 21:25:37 GMT
2007-05-03 21:25:37 GMT
On Thu, Apr 26, 2007 at 12:26:43PM -0400, Sean Boudreau wrote: > On Thu, Apr 26, 2007 at 09:16:07AM -0700, Sam Leffler wrote: > > Sam Leffler wrote: > > > Sean Boudreau wrote: > > >> 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);(Continue reading)
I am about ready to work on this. Let me tell you what I have in mind.
Right now, gre(4) adds/removes encapsulating IP headers, it hooks
into protocol switches in order to "catch" packets sent to its IP
protocol numbers of interest, and it demultiplexes received packets.
We can do all of that with a socket. I will make gre use one.
A socket hides such details of its implementation from gre(4) as the
encapsulation type (IPv4, IPv6, UDP), the protocol hooks, and the
demultiplexing, so I can simplify gre and remove its "hooks" from the
IPv4 stack. Without adding new "hooks," I can add an IPv6 encapsulation
to gre---bonus!
Ok, so there is a catch: a raw IPv4 socket is not suitable for my purpose.
It is not "symmetrical": it removes the IPv4 header from received packets,
but it does not add the IPv4 header to transmitted packets. No other
IPv4 socket is suitable. I need to either add an option to the raw IPv4
socket that makes it supply the IPv4 header, or I need to introduce new,
symmetrical socket types---socket(PF_INET, SOCK_DGRAM, IPPROTO_GRE)?
I am inclined to add an option to the raw socket.
After I convert gre to use sockets, I will add to it the capability to
tunnel ethernet frames.
RSS Feed