summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: b3c87d5)
raw | patch | inline | side by side (parent: b3c87d5)
author | KIvosak <kivos@seznam.cz> | |
Sat, 13 Oct 2012 10:50:40 +0000 (12:50 +0200) | ||
committer | Florian Forster <octo@collectd.org> | |
Sat, 20 Oct 2012 06:48:03 +0000 (08:48 +0200) |
Signed-off-by: Florian Forster <octo@collectd.org>
src/netlink.c | patch | blob | history |
diff --git a/src/netlink.c b/src/netlink.c
index e65aec7ae1a6b7a378f1c2c6c9879d2773be622e..bac87575942b79c7bc80aab84b70aeeae269b293 100644 (file)
--- a/src/netlink.c
+++ b/src/netlink.c
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);
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.");
+ ERROR ("netlink plugin: ir_read: rtnl_wilddump_request failed.");
return (-1);
}