]> git.ipfire.org Git - thirdparty/iproute2.git/commitdiff
new tc_stats handling, and const args to filter
authorosdl.net!shemminger <osdl.net!shemminger>
Tue, 31 Aug 2004 17:45:21 +0000 (17:45 +0000)
committerosdl.net!shemminger <osdl.net!shemminger>
Tue, 31 Aug 2004 17:45:21 +0000 (17:45 +0000)
(Logical change 1.77)

tc/m_action.c

index eb7d0186aa9671a621696fd04c0a13f3f9689886..89ab71fbef56c39fe725dd6b034570a58192f6a5 100644 (file)
@@ -260,27 +260,17 @@ tc_print_one_action(FILE * f, struct rtattr *arg)
        if (0 > err)
                return err;
 
-       if (show_stats) {
-               if (tb[TCA_STATS]) {
-                       if (RTA_PAYLOAD(tb[TCA_STATS]) <
-                           sizeof (struct tc_stats))
-                               fprintf(f, "statistics truncated");
-                       else {
-                               struct tc_stats st;
-                               memcpy(&st, RTA_DATA(tb[TCA_STATS]),
-                                      sizeof (st));
-                               fprintf(f, "\t");
-                               print_tcstats(f, &st);
-                               fprintf(f, "\n");
-                       }
-               }
+       if (show_stats && tb[TCA_STATS]) {
+               fprintf(f, "\t");
+               print_tcstats_attr(f, tb[TCA_STATS]);
+               fprintf(f, "\n");
        }
 
        return 0;
 }
 
 int
-tc_print_action(FILE * f, struct rtattr *arg)
+tc_print_action(FILE * f, const struct rtattr *arg)
 {
 
        int i;
@@ -311,7 +301,9 @@ tc_print_action(FILE * f, struct rtattr *arg)
        return 0;
 }
 
-int do_print_action(struct sockaddr_nl *who, struct nlmsghdr *n, void *arg)
+static int do_print_action(const struct sockaddr_nl *who,
+                          const struct nlmsghdr *n,
+                          void *arg)
 {
        FILE *fp = (FILE*)arg;
        struct tcamsg *t = NLMSG_DATA(n);