]> rtime.felk.cvut.cz Git - lisovros/iproute2_canprio.git/blobdiff - tc/f_rsvp.c
Add reference to tc-codel(8) to the SEE ALSO section
[lisovros/iproute2_canprio.git] / tc / f_rsvp.c
index 8faa22e7275c74bb93ac42dcdf2bd7e43f033772..8eaf85d815200d88f957dd4b16f69e2124389f1b 100644 (file)
@@ -34,10 +34,9 @@ static void explain(void)
        fprintf(stderr, "                u{8|16|32} NUMBER mask MASK at OFFSET}\n");
        fprintf(stderr, "       POLICE_SPEC := ... look at TBF\n");
        fprintf(stderr, "       FILTERID := X:Y\n");
+       fprintf(stderr, "\nNOTE: CLASSID is parsed as hexadecimal input.\n");
 }
 
-#define usage() return(-1)
-
 int get_addr_and_pi(int *argc_p, char ***argv_p, inet_prefix * addr,
                    struct tc_rsvp_pinfo *pinfo, int dir, int family)
 {
@@ -322,9 +321,7 @@ static int rsvp_print_opt(struct filter_util *qu, FILE *f, struct rtattr *opt, _
        if (opt == NULL)
                return 0;
 
-       memset(tb, 0, sizeof(tb));
-       if (opt)
-               parse_rtattr(tb, TCA_RSVP_MAX, RTA_DATA(opt), RTA_PAYLOAD(opt));
+       parse_rtattr_nested(tb, TCA_RSVP_MAX, opt);
 
        if (handle)
                fprintf(f, "fh 0x%08x ", handle);
@@ -339,9 +336,9 @@ static int rsvp_print_opt(struct filter_util *qu, FILE *f, struct rtattr *opt, _
        if (tb[TCA_RSVP_CLASSID]) {
                SPRINT_BUF(b1);
                if (!pinfo || pinfo->tunnelhdr == 0)
-                       fprintf(f, "flowid %s ", sprint_tc_classid(*(__u32*)RTA_DATA(tb[TCA_RSVP_CLASSID]), b1));
+                       fprintf(f, "flowid %s ", sprint_tc_classid(rta_getattr_u32(tb[TCA_RSVP_CLASSID]), b1));
                else
-                       fprintf(f, "tunnel %d skip %d ", *(__u32*)RTA_DATA(tb[TCA_RSVP_CLASSID]), pinfo->tunnelhdr);
+                       fprintf(f, "tunnel %d skip %d ", rta_getattr_u32(tb[TCA_RSVP_CLASSID]), pinfo->tunnelhdr);
        } else if (pinfo && pinfo->tunnelhdr)
                fprintf(f, "tunnel [BAD] skip %d ", pinfo->tunnelhdr);