]> git.proxmox.com Git - mirror_iproute2.git/blobdiff - tc/f_rsvp.c
f_u32: fix compiler gcc-10 compiler warning
[mirror_iproute2.git] / tc / f_rsvp.c
index 65caeb42bfe42ec6d91df32c77c29c4cdbad66e0..388e9ee59ad39e266e3f02375a658453b4082306 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: ... rsvp ipproto PROTOCOL session DST[/PORT | GPI ]\n");
-       fprintf(stderr, "                [ sender SRC[/PORT | GPI ] ]\n");
-       fprintf(stderr, "                [ classid CLASSID ] [ action ACTION_SPEC ]\n");
-       fprintf(stderr, "                [ tunnelid ID ] [ tunnel ID skip NUMBER ]\n");
-       fprintf(stderr, "Where: GPI := { flowlabel NUMBER | spi/ah SPI | spi/esp SPI |\n");
-       fprintf(stderr, "                u{8|16|32} NUMBER mask MASK at OFFSET}\n");
-       fprintf(stderr, "       ACTION_SPEC := ... look at individual actions\n");
-       fprintf(stderr, "       FILTERID := X:Y\n");
-       fprintf(stderr, "\nNOTE: CLASSID is parsed as hexadecimal input.\n");
+       fprintf(stderr,
+               "Usage: ... rsvp ipproto PROTOCOL session DST[/PORT | GPI ]\n"
+               "               [ sender SRC[/PORT | GPI ] ]\n"
+               "               [ classid CLASSID ] [ action ACTION_SPEC ]\n"
+               "               [ tunnelid ID ] [ tunnel ID skip NUMBER ]\n"
+               "Where: GPI := { flowlabel NUMBER | spi/ah SPI | spi/esp SPI |\n"
+               "               u{8|16|32} NUMBER mask MASK at OFFSET}\n"
+               "       ACTION_SPEC := ... look at individual actions\n"
+               "       FILTERID := X:Y\n"
+               "\nNOTE: CLASSID is parsed as hexadecimal input.\n");
 }
 
 static int get_addr_and_pi(int *argc_p, char ***argv_p, inet_prefix *addr,
@@ -170,7 +170,8 @@ done:
 }
 
 
-static int rsvp_parse_opt(struct filter_util *qu, char *handle, int argc, char **argv, struct nlmsghdr *n)
+static int rsvp_parse_opt(struct filter_util *qu, char *handle, int argc,
+                         char **argv, struct nlmsghdr *n)
 {
        int family = strcmp(qu->id, "rsvp") == 0 ? AF_INET : AF_INET6;
        struct tc_rsvp_pinfo pinfo = {};
@@ -188,8 +189,7 @@ static int rsvp_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, "session") == 0) {
@@ -294,7 +294,7 @@ static int rsvp_parse_opt(struct filter_util *qu, char *handle, int argc, char *
 
        if (pinfo_ok)
                addattr_l(n, 4096, TCA_RSVP_PINFO, &pinfo, sizeof(pinfo));
-       tail->rta_len = (void *) NLMSG_TAIL(n) - (void *) tail;
+       addattr_nest_end(n, tail);
        return 0;
 }