Browse Source

collectd: Updated (5.1.0 -> 5.1.3)

user/chris/wip/linux37
Christian Wiese 12 years ago committed by Christian Wiese
parent
commit
4960ff0d3d
  1. 147
      monitor/collectd/collectd-5.1.0-netlink-plugin-rtnl_dump_filter-checkarg.patch
  2. 6
      monitor/collectd/collectd.desc

147
monitor/collectd/collectd-5.1.0-netlink-plugin-rtnl_dump_filter-checkarg.patch

@ -1,147 +0,0 @@
# --- SDE-COPYRIGHT-NOTE-BEGIN ---
# This copyright note is auto-generated by ./scripts/Create-CopyPatch.
#
# Filename: package/.../collectd/collectd-5.1.0-netlink-plugin-rtnl_dump_filter-checkarg.patch
# Copyright (C) 2012 The OpenSDE Project
#
# More information can be found in the files COPYING and README.
#
# This patch file is dual-licensed. It is available under the license the
# patched project is licensed under, as long as it is an OpenSource license
# as defined at http://www.opensource.org/ (e.g. BSD, X11) or under the terms
# of the GNU General Public License as published by the Free Software
# Foundation; either version 2 of the License, or (at your option) any later
# version.
# --- SDE-COPYRIGHT-NOTE-END ---
From 793d766ab645cdb01297889797faf780eb669d40 Mon Sep 17 00:00:00 2001
From: Sebastian Harl <sh@tokkee.org>
Date: Sat, 19 May 2012 12:31:52 +0200
Subject: [PATCH 1/1] netlink plugin: Check for the number of arguments to
'rtnl_dump_filter'.
In recent versions of iproute2, 'rtnl_dump_filter' expects three rather than
five arguments.
This should fix Github issue #7.
Signed-off-by: Florian Forster <octo@collectd.org>
---
configure.in | 66 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++
src/netlink.c | 12 +++++++++++
2 files changed, 78 insertions(+)
diff --git a/configure.in b/configure.in
index 1dc23bf..58c9d27 100644
--- a/configure.in
+++ b/configure.in
@@ -2192,6 +2192,72 @@ then
fi
if test "x$with_libnetlink" = "xyes"
then
+ SAVE_CFLAGS="$CFLAGS"
+ CFLAGS="$CFLAGS $with_libnetlink_cflags"
+
+ AC_CACHE_CHECK(
+ [if function 'rtnl_dump_filter' expects five arguments],
+ [c_cv_rtnl_dump_filter_five_args],
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
+ [
+AC_INCLUDES_DEFAULT
+#if HAVE_LIBNETLINK_H
+# include <libnetlink.h>
+#elif HAVE_IPROUTE_LIBNETLINK_H
+# include <iproute/libnetlink.h>
+#elif HAVE_LINUX_LIBNETLINK_H
+# include <linux/libnetlink.h>
+#endif
+ ],
+ [
+if (rtnl_dump_filter(NULL, NULL, NULL, NULL, NULL))
+ return 1;
+return 0;
+ ]
+ )],
+ [c_cv_rtnl_dump_filter_five_args="yes"],
+ [c_cv_rtnl_dump_filter_five_args="no"]
+ )
+ )
+
+ AC_CACHE_CHECK(
+ [if function 'rtnl_dump_filter' expects three arguments],
+ [c_cv_rtnl_dump_filter_three_args],
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
+ [
+AC_INCLUDES_DEFAULT
+#if HAVE_LIBNETLINK_H
+# include <libnetlink.h>
+#elif HAVE_IPROUTE_LIBNETLINK_H
+# include <iproute/libnetlink.h>
+#elif HAVE_LINUX_LIBNETLINK_H
+# include <linux/libnetlink.h>
+#endif
+ ],
+ [
+if (rtnl_dump_filter(NULL, NULL, NULL))
+ return 1;
+return 0;
+ ]
+ )],
+ [c_cv_rtnl_dump_filter_three_args="yes"],
+ [c_cv_rtnl_dump_filter_three_args="no"]
+ )
+ )
+
+ CFLAGS="$SAVE_CFLAGS"
+
+ if test "x$c_cv_rtnl_dump_filter_five_args" = "xyes"
+ then
+ AC_DEFINE(RTNL_DUMP_FILTER_FIVE_ARGS, 1,
+ [Define to 1 if function 'rtnl_dump_filter' expects five arguments.])
+ fi
+ if test "x$c_cv_rtnl_dump_filter_three_args" = "xyes"
+ then
+ AC_DEFINE(RTNL_DUMP_FILTER_THREE_ARGS, 1,
+ [Define to 1 if function 'rtnl_dump_filter' expects three arguments.])
+ fi
+
BUILD_WITH_LIBNETLINK_CFLAGS="$with_libnetlink_cflags"
BUILD_WITH_LIBNETLINK_LIBS="$with_libnetlink_libs"
AC_SUBST(BUILD_WITH_LIBNETLINK_CFLAGS)
diff --git a/src/netlink.c b/src/netlink.c
index 49c4e99..e65aec7 100644
--- a/src/netlink.c
+++ b/src/netlink.c
@@ -570,8 +570,14 @@ static int ir_read (void)
return (-1);
}
+#ifdef RTNL_DUMP_FILTER_FIVE_ARGS
if (rtnl_dump_filter (&rth, link_filter, /* arg1 = */ NULL,
NULL, NULL) != 0)
+#elif defined(RTNL_DUMP_FILTER_THREE_ARGS)
+ if (rtnl_dump_filter (&rth, link_filter, /* arg = */ NULL) != 0)
+#else
+#error "Failed to determine the number of arguments to 'rtnl_dump_filter'!"
+#endif
{
ERROR ("netlink plugin: ir_read: rtnl_dump_filter failed.");
return (-1);
@@ -608,8 +614,14 @@ static int ir_read (void)
continue;
}
+#ifdef RTNL_DUMP_FILTER_FIVE_ARGS
if (rtnl_dump_filter (&rth, qos_filter, (void *) &ifindex,
NULL, NULL) != 0)
+#elif defined(RTNL_DUMP_FILTER_THREE_ARGS)
+ if (rtnl_dump_filter (&rth, qos_filter, /* arg = */ &ifindex) != 0)
+#else
+#error "Failed to determine the number of arguments to 'rtnl_dump_filter'!"
+#endif
{
ERROR ("netlink plugin: ir_read: rtnl_dump_filter failed.");
continue;
--
1.7.10.4

6
monitor/collectd/collectd.desc

@ -2,7 +2,7 @@
[COPY] This copyright note is auto-generated by ./scripts/Create-CopyPatch.
[COPY]
[COPY] Filename: package/.../collectd/collectd.desc
[COPY] Copyright (C) 2006 - 2012 The OpenSDE Project
[COPY] Copyright (C) 2006 - 2013 The OpenSDE Project
[COPY]
[COPY] More information can be found in the files COPYING and README.
[COPY]
@ -29,7 +29,7 @@
[L] GPL
[S] Stable
[V] 5.1.0
[V] 5.1.3
[P] X -----5---9 800.000
[D] 2385293141 collectd-5.1.0.tar.bz2 http://collectd.org/files/
[D] 2458854585 collectd-5.1.3.tar.bz2 http://collectd.org/files/

Loading…
Cancel
Save