]> git.proxmox.com Git - mirror_iproute2.git/blobdiff - tc/f_route.c
Merge branch 'tc-ets-qdisc' into next
[mirror_iproute2.git] / tc / f_route.c
index e88313f6a7d5835916c21e8f198e6fc6e801d9c9..31fa96a0565e35a6d45c2b700bf0234e13ba55a5 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: ... route [ from REALM | fromif TAG ] [ to REALM ]\n");
-       fprintf(stderr, "                [ classid CLASSID ] [ action ACTION_SPEC ]\n");
-       fprintf(stderr, "       ACTION_SPEC := ... look at individual actions\n");
-       fprintf(stderr, "       CLASSID := X:Y\n");
-       fprintf(stderr, "\nNOTE: CLASSID is parsed as hexadecimal input.\n");
+       fprintf(stderr,
+               "Usage: ... route [ from REALM | fromif TAG ] [ to REALM ]\n"
+               "                [ classid CLASSID ] [ action ACTION_SPEC ]\n"
+               "       ACTION_SPEC := ... look at individual actions\n"
+               "       CLASSID := X:Y\n"
+               "\n"
+               "NOTE: CLASSID is parsed as hexadecimal input.\n");
 }
 
 static int route_parse_opt(struct filter_util *qu, char *handle, int argc, char **argv, struct nlmsghdr *n)
@@ -51,8 +52,7 @@ static int route_parse_opt(struct filter_util *qu, char *handle, int argc, char
        if (argc == 0)
                return 0;
 
-       tail = NLMSG_TAIL(n);
-       addattr_l(n, 4096, TCA_OPTIONS, NULL, 0);
+       tail = addattr_nest(n, 4096, TCA_OPTIONS);
 
        while (argc > 0) {
                if (matches(*argv, "to") == 0) {
@@ -129,7 +129,7 @@ static int route_parse_opt(struct filter_util *qu, char *handle, int argc, char
                }
                argc--; argv++;
        }
-       tail->rta_len = (void *) NLMSG_TAIL(n) - (void *) tail;
+       addattr_nest_end(n, tail);
        if (order) {
                fh &= ~0x7F00;
                fh |= (order<<8)&0x7F00;