Search Linux Wireless

Re: [PATCH 2/2] tkip: remove inlines duplicating byteorder macros

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sat, 2008-03-08 at 07:57 +0100, Johannes Berg wrote:
> On Fri, 2008-03-07 at 19:17 -0800, Harvey Harrison wrote:
> > Also remove Hi16/Lo16 and open code them in the one place they
> > are used.
> 
> >  	int i, j;
> > +	__le16 *ptr = (__le16 *)ta; /* address is held in LE byteorder */
> > +
> > +	p1k[0] = tsc_IV32 & 0xffff;
> > +	p1k[1] = tsc_IV32 >> 16;
> > +	p1k[2] = __le16_to_cpup(ptr++);
> > +	p1k[3] = __le16_to_cpup(ptr++);
> > +	p1k[4] = __le16_to_cpup(ptr);
> >  
> > -	p1k[0] = Lo16(tsc_IV32);
> > -	p1k[1] = Hi16(tsc_IV32);
> > -	p1k[2] = Mk16(ta[1], ta[0]);
> > -	p1k[3] = Mk16(ta[3], ta[2]);
> > -	p1k[4] = Mk16(ta[5], ta[4]);
> 
> NACK! Now the code assumes natural alignment of the u16s which is, as
> far as I can tell, completely bogus. Please review
> Documentation/unaligned-memory-access.txt.

I didn't think about the alignment constraints, true.  Maybe common
_unaligned versions should be added to the kernel infrastructure instead
of hiding these hand-rolled versions in tkip.c?

Harvey


--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]
  Powered by Linux