[syslog-ng] 1.9.11 compile failure on HP-UX 11.23 and AIX 5.x

Albert Chin syslog-ng at mlists.thewrittenword.com
Wed May 31 20:16:55 CEST 2006


I'm getting the same compile failure on HP-UX and AIX using the vendor
compiler:
  xlc -DHAVE_CONFIG_H -I. -I. -I..
  -DPATH_SYSCONFDIR=\"/etc/opt/TWWfsw/syslogng1911\"
  -DPATH_LOCALSTATEDIR=\"/var/opt/TWWfsw/syslogng1911\"
  -I/opt/TWWfsw/libglib26/include -I/opt/TWWfsw/libglib26/lib/include
  -I/opt/TWWfsw/gettext014/include
  -I/opt/TWWfsw/syslogng1911/include/eventlog   -D_GNU_SOURCE  -O2 -ma
  -qro -qroconst -qmaxmem=-1 -qarch=com -c afinet.c
  "/usr/include/alloca.h", line 34.1: 1506-224 (I) Incorrect pragma ignored.
  "afinet.c", line 183.13: 1506-021 (S) Expecting struct or union.
  gmake[2]: *** [afinet.o] Error 1
  gmake[2]: Leaving directory `/opt/build/syslog-ng-1.9.11/src'

The problem is the following line:
  if (IN6_IS_ADDR_MULTICAST(g_sockaddr_inet6_get_address(addr)->s6_addr))

On AIX, from <netinet/in.h>:
  #define IN6_IS_ADDR_MULTICAST(p) IS_MULTIADDR6(*p)
  #define IS_MULTIADDR6(a)         ((a).s6_addr8[0] == 0xff)
  #define s6_addr8                 u6_addr.u6_addr8
  #define s6_addr                  u6_addr.u6_addr8

So, IN6_IS_ADDR_MULTICAST(addr) is converted to IS_MULTIADDR6(*addr)
and then:
  ((*addr).u6_addr.u6_addr8[0] == 0xff

So, because addr == g_sockaddr_inet6_get_address(addr)->s6_addr, we
get the following expansion:
  if (((*g_sockaddr_inet6_get_address(addr)->u6_addr.u6_addr8).u6_addr.u6_addr8[0] == 0xff))

The Redhat Linux definition is:
  #define IN6_IS_ADDR_MULTICAST(a) (((__const uint8_t *) (a))[0] == 0xff)

The HP-UX 11.23 definition is:
  #define IN6_IS_ADDR_MULTICAST(i)     ((((i)->s6_addr[0] ^ 0xff)  \
                                       | ((i)->s6_addr[1] & 0xe0)) == 0)

ntp-4.2.0a also uses IN6_IS_ADDR_MULTICAST but does the following:
  if (IN6_IS_ADDR_MULTICAST(&((struct sockaddr_in6*)srcadr)->sin6_addr))

-- 
albert chin (china at thewrittenword.com)


More information about the syslog-ng mailing list