[Olsr-dev] OLSRd 0.6.0 with ETT available

Henning Rogge (spam-protected)
Thu Sep 30 17:22:27 CEST 2010


On Thursday 30 September 2010 15:05:12 Erik Tromp wrote:
> > I have a question on your encoding of the ETT values in the Hello/TC
> > messages.
> > 
> > In the HELLO messages you seem to be using a 5 byte encoding. OLSR
> > messages have to be 4-byte aligned, so you want to add 3 bytes of
> > padding there. It might crash your nodes on an ARM/MIPS cpu otherwise.
> > 
> > Henning Rogge
> > --
> 
> I just checked it in the code. I have a question:
> 
> Are you sure it will crash an ARM/MIPS cpu? The packets are never read
> directly into their corresponding packet structs. The values in the
> packets are always read via the pkt_get_[u|s]{8|16|32] functions
> (see lq_packet.h) and then copied into the packets structs. I would
> assume these functions can safely read any 8/16/32-bits number from
> any buffer or any address into a packet struct? Or can't they?
> 
> If the can't, shouldn't there be a comment above these functions
> specifying this limitation? And, if they can't, can the ARM_NOWARN_ALIGN
> macro be used? It seems from the rest of the code that this macro is
> used whenever a 16/32 bits value is not aligned.
1.) The OLSR RFC says "every OLSR message have to be 4 byte aligned".
2.) If you have unaligned fields within your message, you might get trouble.
3.) If you have unaligned LENGTH all messages after you in the same packet 
will have trouble. The more recent OLSR code will just drop all messages with 
an odd length.
4.) ARM_NO_WARN_ALIGN is mostly for byte-arrays... or for cases where we know 
more than the compiler.

Henning Rogge

-- 
1) You can't win.
2) You can't break even.
3) You can't leave the game.
— The Laws of Thermodynamics, summarized
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.olsr.org/pipermail/olsr-dev/attachments/20100930/af20fcf7/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.olsr.org/pipermail/olsr-dev/attachments/20100930/af20fcf7/attachment.sig>


More information about the Olsr-dev mailing list