projects
/
collectd.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
135fcb2
)
src/utils_dns.c: Make IPv6 support optional.
author
Florian Forster
<octo@huhu.verplant.org>
Fri, 7 Jan 2011 07:28:32 +0000
(08:28 +0100)
committer
Florian Forster
<octo@huhu.verplant.org>
Fri, 7 Jan 2011 07:28:32 +0000
(08:28 +0100)
src/utils_dns.c
patch
|
blob
|
history
diff --git
a/src/utils_dns.c
b/src/utils_dns.c
index
22c9b95
..
d1c8d5d
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)
{
@@
-512,6
+513,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
+533,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
+631,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
+664,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);
}