]> git.proxmox.com Git - mirror_iproute2.git/blobdiff - tc/f_basic.c
Merge branch 'master' into next
[mirror_iproute2.git] / tc / f_basic.c
index 4adf1d220bebe28d5f65f5381c57203acde530b9..7b19cea6e87e75c060ab822d5463ee73370a1405 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>
 
 static void explain(void)
 {
-       fprintf(stderr, "Usage: ... basic [ match EMATCH_TREE ] \n");
-       fprintf(stderr, "                 [ action ACTION_SPEC ] [ classid CLASSID ]\n");
-       fprintf(stderr, "\n");
-       fprintf(stderr, "Where: SELECTOR := SAMPLE SAMPLE ...\n");
-       fprintf(stderr, "       FILTERID := X:Y:Z\n");
-       fprintf(stderr, "       ACTION_SPEC := ... look at individual actions\n");
-       fprintf(stderr, "\nNOTE: CLASSID is parsed as hexadecimal input.\n");
+       fprintf(stderr,
+               "Usage: ... basic [ match EMATCH_TREE ]\n"
+               "                 [ action ACTION_SPEC ] [ classid CLASSID ]\n"
+               "\n"
+               "Where: SELECTOR := SAMPLE SAMPLE ...\n"
+               "       FILTERID := X:Y:Z\n"
+               "       ACTION_SPEC := ... look at individual actions\n"
+               "\n"
+               "NOTE: CLASSID is parsed as hexadecimal input.\n");
 }
 
 static int basic_parse_opt(struct filter_util *qu, char *handle,
@@ -56,7 +57,7 @@ static int basic_parse_opt(struct filter_util *qu, char *handle,
        if (argc == 0)
                return 0;
 
-       tail = (struct rtattr*)(((void*)n)+NLMSG_ALIGN(n->nlmsg_len));
+       tail = (struct rtattr *)(((void *)n)+NLMSG_ALIGN(n->nlmsg_len));
        addattr_l(n, MAX_MSG, TCA_OPTIONS, NULL, 0);
 
        while (argc > 0) {
@@ -69,7 +70,8 @@ static int basic_parse_opt(struct filter_util *qu, char *handle,
                        continue;
                } else if (matches(*argv, "classid") == 0 ||
                           strcmp(*argv, "flowid") == 0) {
-                       unsigned handle;
+                       unsigned int handle;
+
                        NEXT_ARG();
                        if (get_tc_classid(&handle, *argv)) {
                                fprintf(stderr, "Illegal \"classid\"\n");
@@ -102,7 +104,7 @@ static int basic_parse_opt(struct filter_util *qu, char *handle,
                argc--; argv++;
        }
 
-       tail->rta_len = (((void*)n)+n->nlmsg_len) - (void*)tail;
+       tail->rta_len = (((void *)n)+n->nlmsg_len) - (void *)tail;
        return 0;
 }
 
@@ -134,7 +136,7 @@ static int basic_print_opt(struct filter_util *qu, FILE *f,
        }
 
        if (tb[TCA_BASIC_ACT]) {
-               tc_print_action(f, tb[TCA_BASIC_ACT]);
+               tc_print_action(f, tb[TCA_BASIC_ACT], 0);
        }
 
        return 0;