1 autofs-5.0.4 - srv lookup handle endianness
3 From: Ian Kent <raven@themaw.net>
8 modules/dclist.c | 6 ++++++
9 1 files changed, 6 insertions(+), 0 deletions(-)
12 diff --git a/modules/dclist.c b/modules/dclist.c
13 index 5b0e577..967581c 100644
14 --- a/modules/dclist.c
15 +++ b/modules/dclist.c
18 #include <sys/param.h>
22 #include "automount.h"
25 #define SVAL(buf, pos) (*(const uint16_t *)((const char *)(buf) + (pos)))
26 #define IVAL(buf, pos) (*(const uint32_t *)((const char *)(buf) + (pos)))
28 +#if __BYTE_ORDER == __LITTLE_ENDIAN
29 #define SREV(x) ((((x)&0xFF)<<8) | (((x)>>8)&0xFF))
30 #define IREV(x) ((SREV(x)<<16) | (SREV((x)>>16)))
36 #define RSVAL(buf, pos) SREV(SVAL(buf, pos))
37 #define RIVAL(buf, pos) IREV(IVAL(buf, pos))