projects
/
collectd.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch 'collectd-4.10' into collectd-5.0
[collectd.git]
/
src
/
utils_dns.c
diff --git
a/src/utils_dns.c
b/src/utils_dns.c
index
22c9b95
..
cfa4a5c
100644
(file)
--- a/
src/utils_dns.c
+++ b/
src/utils_dns.c
@@
-441,6
+441,7
@@
handle_udp(const struct udphdr *udp, int len)
return 1;
}
return 1;
}
+#if HAVE_NETINET_IP6_H
static int
handle_ipv6 (struct ip6_hdr *ipv6, int len)
{
static int
handle_ipv6 (struct ip6_hdr *ipv6, int len)
{
@@
-449,7
+450,6
@@
handle_ipv6 (struct ip6_hdr *ipv6, int len)
int nexthdr;
struct in6_addr s_addr;
int nexthdr;
struct in6_addr s_addr;
- struct in6_addr d_addr;
uint16_t payload_len;
if (0 > len)
uint16_t payload_len;
if (0 > len)
@@
-458,7
+458,6
@@
handle_ipv6 (struct ip6_hdr *ipv6, int len)
offset = sizeof (struct ip6_hdr);
nexthdr = ipv6->ip6_nxt;
s_addr = ipv6->ip6_src;
offset = sizeof (struct ip6_hdr);
nexthdr = ipv6->ip6_nxt;
s_addr = ipv6->ip6_src;
- d_addr = ipv6->ip6_dst;
payload_len = ntohs (ipv6->ip6_plen);
if (ignore_list_match (&s_addr))
payload_len = ntohs (ipv6->ip6_plen);
if (ignore_list_match (&s_addr))
@@
-512,6
+511,16
@@
handle_ipv6 (struct ip6_hdr *ipv6, int len)
return (1); /* Success */
} /* int handle_ipv6 */
return (1); /* Success */
} /* int handle_ipv6 */
+/* #endif HAVE_NETINET_IP6_H */
+
+#else /* if !HAVE_NETINET_IP6_H */
+static int
+handle_ipv6 (__attribute__((unused)) void *pkg,
+ __attribute__((unused)) int len)
+{
+ return (0);
+}
+#endif /* !HAVE_NETINET_IP6_H */
static int
handle_ip(const struct ip *ip, int len)
static int
handle_ip(const struct ip *ip, int len)
@@
-522,7
+531,7
@@
handle_ip(const struct ip *ip, int len)
struct in6_addr d_addr;
if (ip->ip_v == 6)
struct in6_addr d_addr;
if (ip->ip_v == 6)
- return (handle_ipv6 ((
struct ip6_hdr
*) ip, len));
+ return (handle_ipv6 ((
void
*) 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 (&d_addr, &ip->ip_dst.s_addr, sizeof (ip->ip_dst.s_addr), AF_INET);
in6_addr_from_buffer (&s_addr, &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);
@@
-620,7
+629,7
@@
handle_ether(const u_char * pkt, int len)
return 0;
memcpy(buf, pkt, len);
if (ETHERTYPE_IPV6 == etype)
return 0;
memcpy(buf, pkt, len);
if (ETHERTYPE_IPV6 == etype)
- return (handle_ipv6 ((
struct ip6_hdr
*) buf, len));
+ return (handle_ipv6 ((
void
*) buf, len));
else
return handle_ip((struct ip *) buf, len);
}
else
return handle_ip((struct ip *) buf, len);
}
@@
-653,7
+662,7
@@
handle_linux_sll (const u_char *pkt, int len)
return 0;
if (ETHERTYPE_IPV6 == etype)
return 0;
if (ETHERTYPE_IPV6 == etype)
- return (handle_ipv6 ((
struct ip6_hdr
*) pkt, len));
+ return (handle_ipv6 ((
void
*) pkt, len));
else
return handle_ip((struct ip *) pkt, len);
}
else
return handle_ip((struct ip *) pkt, len);
}