iproute2: gnet_stats
(Logical change 1.107)
diff --git a/tc/tc_class.c b/tc/tc_class.c
index b4aae95..8b0c616 100644
--- a/tc/tc_class.c
+++ b/tc/tc_class.c
@@ -216,12 +216,14 @@
}
fprintf(fp, "\n");
if (show_stats) {
- if (tb[TCA_STATS]) {
- print_tcstats_attr(fp, tb[TCA_STATS]);
+ struct rtattr *xstats = NULL;
+
+ if (tb[TCA_STATS] || tb[TCA_STATS2]) {
+ print_tcstats_attr(fp, tb, " ", &xstats);
fprintf(fp, "\n");
}
- if (q && tb[TCA_XSTATS] && q->print_xstats) {
- q->print_xstats(q, fp, tb[TCA_XSTATS]);
+ if (q && (xstats || tb[TCA_XSTATS]) && q->print_xstats) {
+ q->print_xstats(q, fp, xstats ? : tb[TCA_XSTATS]);
fprintf(fp, "\n");
}
}