I am trying to build collectd (4.8.1) on OpenSolaris but it fails to build
due to the following error:
"utils_dns.c", line 319: warning: statement not reached
"utils_dns.c", line 434: syntax error before or at: .
"utils_dns.c", line 435: invalid type combination
"utils_dns.c", line 443: improper member use: S_addr
"utils_dns.c", line 443: assignment type mismatch:
unsigned int "=" struct in6_addr {union {..} _S6_un}
"utils_dns.c", line 447: improper member use: S_addr
"utils_dns.c", line 447: warning: argument #1 is incompatible with
prototype:
prototype: pointer to const struct in6_addr {union {..} _S6_un} :
"utils_dns.c", line 197
argument : pointer to unsigned int
"utils_dns.c", line 460: incomplete struct/union/enum ip6_ext: ext_hdr
"utils_dns.c", line 472: undefined struct/union member: ip6e_nxt
"utils_dns.c", line 473: undefined struct/union member: ip6e_len
"utils_dns.c", line 504: syntax error before or at: .
"utils_dns.c", line 505: invalid type combination
"utils_dns.c", line 510: improper member use: S_addr
"utils_dns.c", line 510: warning: argument #1 is incompatible with
prototype:
prototype: pointer to struct in6_addr {union {..} _S6_un} :
"utils_dns.c", line 259
argument : pointer to unsigned int
"utils_dns.c", line 512: improper member use: S_addr
"utils_dns.c", line 512: warning: argument #1 is incompatible with
prototype:
prototype: pointer to const struct in6_addr {union {..} _S6_un} :
"utils_dns.c", line 197
argument : pointer to unsigned int
"utils_dns.c", line 516: warning: pointer to void or function used in
arithmetic
"utils_dns.c", line 821: warning: statement not reached
"utils_dns.c", line 892: warning: statement not reached
There seems to be two issues:
- S_addr member already exists in netinet/in.h on Solaris/OpenSolaris and
thus changing the variable name in utils_dns.c will fix this issue.
- struct ip6_ext is defined in netinet/ip_compat.h for Solaris
10/OpenSolaris and thus needs to be included in utils_dns.c.
Do find a patch attached and let me know if the fix looks okay.
Regards
Amit
--- collectd-4.8.1/src/utils_dns.c Sun Oct 4 00:46:13 2009
+++ collectd-4.8.1-mine/src/utils_dns.c Wed Feb 10 03:23:09 2010
@@ -39,6 +39,9 @@
#include "plugin.h"
#include "common.h"
+#define SOLARIS2 10
+#include <netinet/ip_compat.h>
+
#if HAVE_NETINET_IN_SYSTM_H
# include <netinet/in_systm.h>
#endif
@@ -431,7 +434,7 @@
unsigned int offset;
int nexthdr;
- struct in6_addr s_addr;
+ struct in6_addr saddr;
struct in6_addr d_addr;
uint16_t payload_len;
@@ -440,11 +443,11 @@
offset = sizeof (struct ip6_hdr);
nexthdr = ipv6->ip6_nxt;
- s_addr = ipv6->ip6_src;
+ saddr = ipv6->ip6_src;
d_addr = ipv6->ip6_dst;
payload_len = ntohs (ipv6->ip6_plen);
- if (ignore_list_match (&s_addr))
+ if (ignore_list_match (&saddr))
return (0);
/* Parse extension headers. This only handles the standard headers, as
@@ -501,15 +504,15 @@
{
char buf[PCAP_SNAPLEN];
int offset = ip->ip_hl << 2;
- struct in6_addr s_addr;
+ struct in6_addr saddr;
struct in6_addr d_addr;
if (ip->ip_v == 6)
return (handle_ipv6 ((struct ip6_hdr *) ip, len));
- in6_addr_from_buffer (&s_addr, &ip->ip_src.s_addr, sizeof (ip->ip_src.s_addr), AF_INET);
+ in6_addr_from_buffer (&saddr, &ip->ip_src.s_addr, sizeof (ip->ip_src.s_addr), AF_INET);
in6_addr_from_buffer (&d_addr, &ip->ip_dst.s_addr, sizeof (ip->ip_dst.s_addr), AF_INET);
- if (ignore_list_match (&s_addr))
+ if (ignore_list_match (&saddr))
return (0);
if (IPPROTO_UDP != ip->ip_p)
return 0;
_______________________________________________
collectd mailing list
[email protected]
http://mailman.verplant.org/listinfo/collectd