diff options
author | osdl.net!shemminger <osdl.net!shemminger> | 2004-08-31 17:45:21 +0000 |
---|---|---|
committer | osdl.net!shemminger <osdl.net!shemminger> | 2004-08-31 17:45:21 +0000 |
commit | de481780a582f2800a6398296f2ca8269a3ddcfb (patch) | |
tree | 75ab3f492499fc1fbb1f1763e8a8ca13921f07b6 /tc | |
parent | 649b0755ccce0f17a04fdbc37c93166fa6612edb (diff) |
handle new tcstats
(Logical change 1.77)
Diffstat (limited to 'tc')
-rw-r--r-- | tc/tc_filter.c | 19 |
1 files changed, 7 insertions, 12 deletions
diff --git a/tc/tc_filter.c b/tc/tc_filter.c index 8f2a0b86..74e99695 100644 --- a/tc/tc_filter.c +++ b/tc/tc_filter.c @@ -185,7 +185,9 @@ static int filter_ifindex; static __u32 filter_prio; static __u32 filter_protocol; -int print_filter(struct sockaddr_nl *who, struct nlmsghdr *n, void *arg) +static int print_filter(const struct sockaddr_nl *who, + const struct nlmsghdr *n, + void *arg) { FILE *fp = (FILE*)arg; struct tcmsg *t = NLMSG_DATA(n); @@ -252,18 +254,11 @@ int print_filter(struct sockaddr_nl *who, struct nlmsghdr *n, void *arg) } fprintf(fp, "\n"); - if (show_stats) { - if (tb[TCA_STATS]) { - if (RTA_PAYLOAD(tb[TCA_STATS]) < sizeof(struct tc_stats)) - fprintf(fp, "statistics truncated"); - else { - struct tc_stats st; - memcpy(&st, RTA_DATA(tb[TCA_STATS]), sizeof(st)); - print_tcstats(fp, &st); - fprintf(fp, "\n"); - } - } + if (show_stats && tb[TCA_STATS]) { + print_tcstats_attr(fp, tb[TCA_STATS]); + fprintf(fp, "\n"); } + fflush(fp); return 0; } |