projects
/
collectd.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
treewide: add blank line below collectd.h
[collectd.git]
/
src
/
dns.c
diff --git
a/src/dns.c
b/src/dns.c
index
3421c47
..
17f8796
100644
(file)
--- a/
src/dns.c
+++ b/
src/dns.c
@@
-25,12
+25,12
@@
#define _BSD_SOURCE
#include "collectd.h"
#define _BSD_SOURCE
#include "collectd.h"
+
#include "common.h"
#include "plugin.h"
#include "configfile.h"
#include "utils_dns.h"
#include "common.h"
#include "plugin.h"
#include "configfile.h"
#include "utils_dns.h"
-#include <pthread.h>
#include <poll.h>
#include <pcap.h>
#include <poll.h>
#include <pcap.h>
@@
-94,11
+94,10
@@
static counter_list_t *counter_list_create (counter_list_t **list,
{
counter_list_t *entry;
{
counter_list_t *entry;
- entry =
(counter_list_t *) malloc (sizeof (counter_list_t
));
+ entry =
calloc (1, sizeof (*entry
));
if (entry == NULL)
return (NULL);
if (entry == NULL)
return (NULL);
- memset (entry, 0, sizeof (counter_list_t));
entry->key = key;
entry->value = value;
entry->key = key;
entry->value = value;
@@
-212,7
+211,7
@@
static int dns_run_pcap_loop (void)
{
pcap_t *pcap_obj;
char pcap_error[PCAP_ERRBUF_SIZE];
{
pcap_t *pcap_obj;
char pcap_error[PCAP_ERRBUF_SIZE];
- struct bpf_program fp;
+ struct bpf_program fp
= { 0 }
;
int status;
int status;
@@
-239,7
+238,6
@@
static int dns_run_pcap_loop (void)
return (PCAP_ERROR);
}
return (PCAP_ERROR);
}
- memset (&fp, 0, sizeof (fp));
status = pcap_compile (pcap_obj, &fp, "udp port 53", 1, 0);
if (status < 0)
{
status = pcap_compile (pcap_obj, &fp, "udp port 53", 1, 0);
if (status < 0)
{