summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 55ffaf9)
raw | patch | inline | side by side (parent: 55ffaf9)
author | Florian Forster <octo@collectd.org> | |
Sun, 5 Nov 2017 05:23:24 +0000 (06:23 +0100) | ||
committer | Florian Forster <octo@collectd.org> | |
Sun, 5 Nov 2017 05:23:24 +0000 (06:23 +0100) |
Issue: #2510
src/netlink.c | patch | blob | history |
diff --git a/src/netlink.c b/src/netlink.c
index 8076c1fa4436b21fd52533ea379c2f09ea74b8a4..66129ad8c3b39d4e757a59171317ccaffdbd889d 100644 (file)
--- a/src/netlink.c
+++ b/src/netlink.c
continue;
if (mnl_attr_validate2(attr, MNL_TYPE_UNSPEC, sizeof(*stats.stats64)) < 0) {
+ char errbuf[1024];
ERROR("netlink plugin: link_filter_cb: IFLA_STATS64 mnl_attr_validate2 "
- "failed.");
+ "failed: %s",
+ sstrerror(errno, errbuf, sizeof(errbuf)));
return MNL_CB_ERROR;
}
stats.stats64 = mnl_attr_get_payload(attr);
continue;
if (mnl_attr_validate2(attr, MNL_TYPE_UNSPEC, sizeof(*stats.stats32)) < 0) {
+ char errbuf[1024];
ERROR("netlink plugin: link_filter_cb: IFLA_STATS mnl_attr_validate2 "
- "failed.");
+ "failed: %s",
+ sstrerror(errno, errbuf, sizeof(errbuf)));
return MNL_CB_ERROR;
}
stats.stats32 = mnl_attr_get_payload(attr);
if (mnl_attr_get_type(attr) == TCA_STATS_BASIC) {
if (mnl_attr_validate2(attr, MNL_TYPE_UNSPEC, sizeof(**bs)) < 0) {
+ char errbuf[1024];
ERROR("netlink plugin: qos_attr_cb: TCA_STATS_BASIC mnl_attr_validate2 "
- "failed.");
+ "failed: %s",
+ sstrerror(errno, errbuf, sizeof(errbuf)));
return MNL_CB_ERROR;
}
*bs = mnl_attr_get_payload(attr);
continue;
if (mnl_attr_validate2(attr, MNL_TYPE_UNSPEC, sizeof(*ts)) < 0) {
+ char errbuf[1024];
ERROR("netlink plugin: qos_filter_cb: TCA_STATS mnl_attr_validate2 "
- "failed.");
+ "failed: %s",
+ sstrerror(errno, errbuf, sizeof(errbuf)));
return MNL_CB_ERROR;
}
ts = mnl_attr_get_payload(attr);
ret = mnl_socket_recvfrom(nl, buf, sizeof(buf));
}
if (ret < 0) {
- ERROR("netlink plugin: ir_read: mnl_socket_recvfrom failed.");
+ char errbuf[1024];
+ ERROR("netlink plugin: ir_read: mnl_socket_recvfrom failed: %s",
+ sstrerror(errno, errbuf, sizeof(errbuf)));
return (-1);
}
ret = mnl_socket_recvfrom(nl, buf, sizeof(buf));
}
if (ret < 0) {
- ERROR("netlink plugin: ir_read:mnl_socket_recvfrom failed.");
+ char errbuf[1024];
+ ERROR("netlink plugin: ir_read: mnl_socket_recvfrom failed: %s",
+ sstrerror(errno, errbuf, sizeof(errbuf)));
continue;
}
-
} /* for (type_index) */
} /* for (if_index) */