projects
/
collectd.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch 'pr/2431'
[collectd.git]
/
src
/
ipvs.c
diff --git
a/src/ipvs.c
b/src/ipvs.c
index
cef2e2c
..
3d399bd
100644
(file)
--- a/
src/ipvs.c
+++ b/
src/ipvs.c
@@
-42,14
+42,7
@@
#include <netinet/in.h>
#endif /* HAVE_NETINET_IN_H */
#include <netinet/in.h>
#endif /* HAVE_NETINET_IN_H */
-/* this can probably only be found in the kernel sources */
-#if HAVE_LINUX_IP_VS_H
#include <linux/ip_vs.h>
#include <linux/ip_vs.h>
-#elif HAVE_NET_IP_VS_H
-#include <net/ip_vs.h>
-#elif HAVE_IP_VS_H
-#include <ip_vs.h>
-#endif /* HAVE_IP_VS_H */
#define log_err(...) ERROR("ipvs: " __VA_ARGS__)
#define log_info(...) INFO("ipvs: " __VA_ARGS__)
#define log_err(...) ERROR("ipvs: " __VA_ARGS__)
#define log_info(...) INFO("ipvs: " __VA_ARGS__)
@@
-179,8
+172,8
@@
static int get_pi(struct ip_vs_service_entry *se, char *pi, size_t size) {
struct in_addr addr = {.s_addr = se->addr};
int len =
struct in_addr addr = {.s_addr = se->addr};
int len =
- s
s
nprintf(pi, size, "%s_%s%u", inet_ntoa(addr),
-
(se->protocol == IPPROTO_TCP) ? "TCP" : "UDP", ntohs(se->port));
+ snprintf(pi, size, "%s_%s%u", inet_ntoa(addr),
+ (se->protocol == IPPROTO_TCP) ? "TCP" : "UDP", ntohs(se->port));
if ((len < 0) || (size <= ((size_t)len))) {
log_err("plugin instance truncated: %s", pi);
if ((len < 0) || (size <= ((size_t)len))) {
log_err("plugin instance truncated: %s", pi);
@@
-196,7
+189,7
@@
static int get_ti(struct ip_vs_dest_entry *de, char *ti, size_t size) {
struct in_addr addr = {.s_addr = de->addr};
struct in_addr addr = {.s_addr = de->addr};
- int len = s
s
nprintf(ti, size, "%s_%u", inet_ntoa(addr), ntohs(de->port));
+ int len = snprintf(ti, size, "%s_%u", inet_ntoa(addr), ntohs(de->port));
if ((len < 0) || (size <= ((size_t)len))) {
log_err("type instance truncated: %s", ti);
if ((len < 0) || (size <= ((size_t)len))) {
log_err("type instance truncated: %s", ti);