projects
/
collectd.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
python plugin: review fixes
[collectd.git]
/
src
/
utils_dns.c
diff --git
a/src/utils_dns.c
b/src/utils_dns.c
index
991d346
..
2a1e2e5
100644
(file)
--- a/
src/utils_dns.c
+++ b/
src/utils_dns.c
@@
-37,6
+37,7
@@
#define _BSD_SOURCE
#include "collectd.h"
#define _BSD_SOURCE
#include "collectd.h"
+
#include "plugin.h"
#include "common.h"
#include "plugin.h"
#include "common.h"
@@
-194,9
+195,7
@@
static int cmp_in6_addr (const struct in6_addr *a,
static inline int ignore_list_match (const struct in6_addr *addr)
{
static inline int ignore_list_match (const struct in6_addr *addr)
{
- ip_list_t *ptr;
-
- for (ptr = IgnoreList; ptr != NULL; ptr = ptr->next)
+ for (ip_list_t *ptr = IgnoreList; ptr != NULL; ptr = ptr->next)
if (cmp_in6_addr (addr, &ptr->addr) == 0)
return (1);
return (0);
if (cmp_in6_addr (addr, &ptr->addr) == 0)
return (1);
return (0);
@@
-225,7
+224,6
@@
static void ignore_list_add (const struct in6_addr *addr)
void ignore_list_add_name (const char *name)
{
struct addrinfo *ai_list;
void ignore_list_add_name (const char *name)
{
struct addrinfo *ai_list;
- struct addrinfo *ai_ptr;
struct in6_addr addr;
int status;
struct in6_addr addr;
int status;
@@
-233,7
+231,7
@@
void ignore_list_add_name (const char *name)
if (status != 0)
return;
if (status != 0)
return;
- for (ai_ptr = ai_list; ai_ptr != NULL; ai_ptr = ai_ptr->ai_next)
+ for (
struct addrinfo *
ai_ptr = ai_list; ai_ptr != NULL; ai_ptr = ai_ptr->ai_next)
{
if (ai_ptr->ai_family == AF_INET)
{
{
if (ai_ptr->ai_family == AF_INET)
{
@@
-283,8
+281,7
@@
void dnstop_set_callback (void (*cb) (const rfc1035_header_t *))
#define RFC1035_MAXLABELSZ 63
static int
#define RFC1035_MAXLABELSZ 63
static int
-rfc1035NameUnpack(const char *buf, size_t sz, off_t * off, char *name, size_t ns
-)
+rfc1035NameUnpack(const char *buf, size_t sz, off_t * off, char *name, size_t ns)
{
off_t no = 0;
unsigned char c;
{
off_t no = 0;
unsigned char c;
@@
-292,7
+289,7
@@
rfc1035NameUnpack(const char *buf, size_t sz, off_t * off, char *name, size_t ns
static int loop_detect = 0;
if (loop_detect > 2)
return 4; /* compression loop */
static int loop_detect = 0;
if (loop_detect > 2)
return 4; /* compression loop */
- if (ns
<
= 0)
+ if (ns
=
= 0)
return 4; /* probably compression loop */
do {
if ((*off) >= ((off_t) sz))
return 4; /* probably compression loop */
do {
if ((*off) >= ((off_t) sz))
@@
-324,7
+321,6
@@
rfc1035NameUnpack(const char *buf, size_t sz, off_t * off, char *name, size_t ns
* "(The 10 and 01 combinations are reserved for future use.)"
*/
return 3; /* reserved label/compression flags */
* "(The 10 and 01 combinations are reserved for future use.)"
*/
return 3; /* reserved label/compression flags */
- break;
} else {
(*off)++;
len = (size_t) c;
} else {
(*off)++;
len = (size_t) c;
@@
-830,9
+826,7
@@
const char *qtype_str(int t)
default:
ssnprintf (buf, sizeof (buf), "#%i", t);
return (buf);
default:
ssnprintf (buf, sizeof (buf), "#%i", t);
return (buf);
- }; /* switch (t) */
- /* NOTREACHED */
- return (NULL);
+ } /* switch (t) */
}
const char *opcode_str (int o)
}
const char *opcode_str (int o)
@@
-841,24
+835,18
@@
const char *opcode_str (int o)
switch (o) {
case 0:
return "Query";
switch (o) {
case 0:
return "Query";
- break;
case 1:
return "Iquery";
case 1:
return "Iquery";
- break;
case 2:
return "Status";
case 2:
return "Status";
- break;
case 4:
return "Notify";
case 4:
return "Notify";
- break;
case 5:
return "Update";
case 5:
return "Update";
- break;
default:
ssnprintf(buf, sizeof (buf), "Opcode%d", o);
return buf;
}
default:
ssnprintf(buf, sizeof (buf), "Opcode%d", o);
return buf;
}
- /* NOTREACHED */
}
const char *rcode_str (int rcode)
}
const char *rcode_str (int rcode)
@@
-902,8
+890,6
@@
const char *rcode_str (int rcode)
ssnprintf (buf, sizeof (buf), "RCode%i", rcode);
return (buf);
}
ssnprintf (buf, sizeof (buf), "RCode%i", rcode);
return (buf);
}
- /* Never reached */
- return (NULL);
} /* const char *rcode_str (int rcode) */
#if 0
} /* const char *rcode_str (int rcode) */
#if 0