author | Marc Fournier <marc.fournier@camptocamp.com> | |
Mon, 6 Nov 2017 21:25:33 +0000 (22:25 +0100) | ||
committer | Marc Fournier <marc.fournier@camptocamp.com> | |
Mon, 6 Nov 2017 21:25:33 +0000 (22:25 +0100) |
Conflicts:
src/netlink.c
src/netlink.c
1 | 2 | |||
---|---|---|---|---|
src/netlink.c | patch | | diff1 | | diff2 | | blob | history |
diff --cc src/netlink.c
index 0bac3e7582dddb8b1a084e8a42fb1aa073454225,66129ad8c3b39d4e757a59171317ccaffdbd889d..b5ae3bd2c13058ded2aa1902ebfefc2bf9a58fab
--- 1/src/netlink.c
--- 2/src/netlink.c
+++ b/src/netlink.c
return MNL_CB_OK;
if (mnl_attr_get_type(attr) == TCA_STATS_BASIC) {
- if (mnl_attr_validate2(attr, MNL_TYPE_UNSPEC, sizeof(**bs)) < 0) {
+ if (mnl_attr_validate2(attr, MNL_TYPE_UNSPEC, sizeof(*q_stats->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);
- return MNL_CB_STOP;
+ q_stats->bs = mnl_attr_get_payload(attr);
+ return MNL_CB_OK;
+ }
+
+ if (mnl_attr_get_type(attr) == TCA_STATS_QUEUE) {
+ if (mnl_attr_validate2(attr, MNL_TYPE_UNSPEC, sizeof(*q_stats->qs)) < 0) {
+ ERROR("netlink plugin: qos_attr_cb: TCA_STATS_QUEUE mnl_attr_validate2 "
+ "failed.");
+ return MNL_CB_ERROR;
+ }
+ q_stats->qs = mnl_attr_get_payload(attr);
+ return MNL_CB_OK;
}
return MNL_CB_OK;