]> git.proxmox.com Git - mirror_iproute2.git/blobdiff - tc/tc_monitor.c
tc: Remove pointless assignments in batch()
[mirror_iproute2.git] / tc / tc_monitor.c
index ebb94320837bd123f721d134c6892a194169ae32..1f1ee08fb9cf89844f92cba2f5594c5ae058a8b4 100644 (file)
@@ -13,7 +13,6 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <unistd.h>
-#include <syslog.h>
 #include <fcntl.h>
 #include <sys/socket.h>
 #include <netinet/in.h>
@@ -39,12 +38,15 @@ static int accept_tcmsg(const struct sockaddr_nl *who,
                        struct rtnl_ctrl_data *ctrl,
                        struct nlmsghdr *n, void *arg)
 {
-       FILE *fp = (FILE*)arg;
+       FILE *fp = (FILE *)arg;
 
        if (timestamp)
                print_timestamp(fp);
 
-       if (n->nlmsg_type == RTM_NEWTFILTER || n->nlmsg_type == RTM_DELTFILTER) {
+       if (n->nlmsg_type == RTM_NEWTFILTER ||
+           n->nlmsg_type == RTM_DELTFILTER ||
+           n->nlmsg_type == RTM_NEWCHAIN ||
+           n->nlmsg_type == RTM_DELCHAIN) {
                print_filter(who, n, arg);
                return 0;
        }
@@ -73,7 +75,7 @@ int do_tcmonitor(int argc, char **argv)
 {
        struct rtnl_handle rth;
        char *file = NULL;
-       unsigned groups = nl_mgrp(RTNLGRP_TC);
+       unsigned int groups = nl_mgrp(RTNLGRP_TC);
 
        while (argc > 0) {
                if (matches(*argv, "file") == 0) {
@@ -109,7 +111,7 @@ int do_tcmonitor(int argc, char **argv)
 
        ll_init_map(&rth);
 
-       if (rtnl_listen(&rth, accept_tcmsg, (void*)stdout) < 0) {
+       if (rtnl_listen(&rth, accept_tcmsg, (void *)stdout) < 0) {
                rtnl_close(&rth);
                exit(2);
        }