[Xorp-hackers] Alignment problem in xrl_args.cc on xScale

Bruce M Simpson bms at incunabulum.net
Mon Oct 27 04:38:08 PDT 2008


Hi,

When cross-compiling XORP for XScale, there is an alignment error 
triggered by line 776 of xrl_args.cc, causing compilation to fail. This 
is a reinterpret_cast from uint8_t* to uint32_t*.

Now at this point in the XRL code there appears to be no guarantee that 
the buffer passed to XrlArgs::unpack_header() will conform to any 
arbitrary alignment as may be required by the target platform.

The "right fix" to my mind is to use the extract_32() inline function 
from libproto/packet.hh, as the code immediately calls ntohl() on the 
casted rvalue.

Thoughts?
BMS



More information about the Xorp-hackers mailing list