On Sat, 2002-11-16 at 02:38, Stefan (metze) Metzmacher wrote: > Hi, > > I add #define REPLACE_INET_NTOA 1 to config.h > > and in the debug's I got '7.5.0.10' not not '10.0.5.7 as ip. > > WORDS_BIGENDIAN is undefined (SuSE 7.3 i386) > > is this really right??? > (lib/replace.c) > ... > #ifdef REPLACE_INET_NTOA > char *rep_inet_ntoa(struct in_addr ip) > { > unsigned char *p = (unsigned char *)&ip.s_addr; > static char buf[18]; > #if WORDS_BIGENDIAN > slprintf(buf, 17, "%d.%d.%d.%d", > (int)p[0], (int)p[1], (int)p[2], (int)p[3]); > #else /* WORDS_BIGENDIAN */ > slprintf(buf, 17, "%d.%d.%d.%d", > (int)p[3], (int)p[2], (int)p[1], (int)p[0]); > #endif /* WORDS_BIGENDIAN */ > return buf; > } > #endif /* REPLACE_INET_NTOA */
The manpage indicates that (on linux) this is stored in network byte order, so the 'little endien' case would indeed be wrong. Can somebody else confirm this? Andrew Bartlett -- Andrew Bartlett [EMAIL PROTECTED] Manager, Authentication Subsystems, Samba Team [EMAIL PROTECTED] Student Network Administrator, Hawker College [EMAIL PROTECTED] http://samba.org http://build.samba.org http://hawkerc.net
signature.asc
Description: This is a digitally signed message part