[patch] NRPE for big endian archs

Andreas Ericsson ae at op5.se
Thu Aug 7 10:39:20 CEST 2008


Klaus Kuehnhammer wrote:
> Hi,
> 
> I've been asked to make the NRPE daemon work on a custom Coldfire board
> (arch m68k), w/Nagios querying the daemon from a linux box.
> 
> I ran into some issues with the way CRC32 sums are calculated, as well as
> the packet struct getting differently aligned on the host and board
> (causing the buffer start to be off by 2 bytes depending on where the
> word-align paddings goes and/or the compilers disagreeing on the struct
> size).
> 
> The attached patches solve both problems for me, but break compatibility to
> other builds on account of the changed packet struct. I can't think of a
> quick way to avoid that at the moment.
>

Use "__attribute__((__packed__))" in the struct declaration and everywhere
that struct is included in other structs.

-- 
Andreas Ericsson                   andreas.ericsson at op5.se
OP5 AB                             www.op5.se
Tel: +46 8-230225                  Fax: +46 8-230231

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/




More information about the Developers mailing list