[packages] fixes netlink / 3.3 related collectd breakage

fixes #11348, #11610, #11490

thanks hnyman

git-svn-id: svn://svn.openwrt.org/openwrt/packages@32121 3c298f89-4303-0410-b956-a3cf2f4a3e73
This commit is contained in:
blogic 2012-06-07 17:01:32 +00:00
parent 75a2f2fff1
commit 53ca3acec3

View File

@ -0,0 +1,50 @@
Index: collectd-4.10.7/src/netlink.c
===================================================================
--- collectd-4.10.7.orig/src/netlink.c 2012-04-01 16:20:24.000000000 +0200
+++ collectd-4.10.7/src/netlink.c 2012-06-07 17:22:16.212616882 +0200
@@ -223,7 +223,7 @@
msg = NLMSG_DATA (nmh);
- msg_len = nmh->nlmsg_len - sizeof (struct ifinfomsg);
+ msg_len = nmh->nlmsg_len - NLMSG_LENGTH(sizeof (struct ifinfomsg));
if (msg_len < 0)
{
ERROR ("netlink plugin: link_filter: msg_len = %i < 0;", msg_len);
@@ -554,24 +554,19 @@
static int ir_read (void)
{
- struct ifinfomsg im;
struct tcmsg tm;
int ifindex;
static const int type_id[] = { RTM_GETQDISC, RTM_GETTCLASS, RTM_GETTFILTER };
static const char *type_name[] = { "qdisc", "class", "filter" };
- memset (&im, '\0', sizeof (im));
- im.ifi_type = AF_UNSPEC;
-
- if (rtnl_dump_request (&rth, RTM_GETLINK, &im, sizeof (im)) < 0)
+ if (rtnl_wilddump_request (&rth, AF_UNSPEC, RTM_GETLINK) < 0)
{
ERROR ("netlink plugin: ir_read: rtnl_dump_request failed.");
return (-1);
}
- if (rtnl_dump_filter (&rth, link_filter, /* arg1 = */ NULL,
- NULL, NULL) != 0)
+ if (rtnl_dump_filter (&rth, link_filter, /* arg1 = */ NULL) != 0)
{
ERROR ("netlink plugin: ir_read: rtnl_dump_filter failed.");
return (-1);
@@ -608,8 +603,7 @@
continue;
}
- if (rtnl_dump_filter (&rth, qos_filter, (void *) &ifindex,
- NULL, NULL) != 0)
+ if (rtnl_dump_filter (&rth, qos_filter, (void *) &ifindex) != 0)
{
ERROR ("netlink plugin: ir_read: rtnl_dump_filter failed.");
continue;