X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Futils_dns.c;h=cfa4a5cbefff989c28e4a46accb89e00f1a93f59;hb=ba2ee9aec4c0454eed8f29b4c6ce96c6fc372346;hp=22c9b95994377f9ed1752d4192eb25c29a97b8e8;hpb=a898c17330d9a2039bcdb8f7e6dbedba516a6cd8;p=collectd.git diff --git a/src/utils_dns.c b/src/utils_dns.c index 22c9b959..cfa4a5cb 100644 --- a/src/utils_dns.c +++ b/src/utils_dns.c @@ -441,6 +441,7 @@ handle_udp(const struct udphdr *udp, int len) return 1; } +#if HAVE_NETINET_IP6_H 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; - struct in6_addr d_addr; 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; - d_addr = ipv6->ip6_dst; 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 */ +/* #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) @@ -522,7 +531,7 @@ handle_ip(const struct ip *ip, int len) 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); @@ -620,7 +629,7 @@ handle_ether(const u_char * pkt, int len) 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); } @@ -653,7 +662,7 @@ handle_linux_sll (const u_char *pkt, int len) 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); }