tech-net archive

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

Re: Patches fixing unaligned access in the networking code



> I don't like this manual concatenation of bytes and this was rejected
> previously as prone to timing issues while memcpy() does the right
> thing.

...at the price of forcing the written-to datum into memory.

Whether the arithmetic is more expensive than touching memory is, of
course, hardware dependent, but I suspect it is faster to "manually" do
the misaligned load than it is to touch memory on almost all machines,
probably including all machines NetBSD cares about.

More siginificant, to me, is that the addresses are indeed misaligned,
but everyone seems to think they should be aligned.  Whether the bug is
in code (this code or other code) or in people's mental model, I don't
know, but I would say it needs fixing.

/~\ The ASCII				  Mouse
\ / Ribbon Campaign
 X  Against HTML		mouse%rodents-montreal.org@localhost
/ \ Email!	     7D C8 61 52 5D E7 2D 39  4E F1 31 3E E8 B3 27 4B


Home | Main Index | Thread Index | Old Index