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



>>> More siginificant, to me, [...]
>> The Ethernet header is not helping us here...  [...]
> Use trailer encapsulation? :-)

Or, in case of desperation, you could even just acknowledge that what's
really going on is converting between an in-core data structure and a
serialization of that data structure, and actually convert between them
instead of depending on unwarranted chumminess with the compiler to
trust that it will lay out a particular struct in such a way that
overlaying it onto the buffer will match the serialization in question.

The more code I see that serializes and deserializes by overlaying
structs onto buffers, the more strongly I am forced to the conclusion
that it is a technique whose benefits are not worth its costs.

/~\ 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