]> rtime.felk.cvut.cz Git - lisovros/iproute2_canprio.git/blobdiff - tc/f_tcindex.c
Convert to use rta_getattr_ functions
[lisovros/iproute2_canprio.git] / tc / f_tcindex.c
index 39ac75adcc1eedfc40e4d6d9082ac58aa59008a9..590c0a6fc14bcc8d18a2ae0acb9728607584c911 100644 (file)
@@ -24,10 +24,6 @@ static void explain(void)
            "[ police POLICE_SPEC ]\n");
 }
 
-
-#define usage() return(-1)
-
-
 static int tcindex_parse_opt(struct filter_util *qu, char *handle, int argc,
     char **argv, struct nlmsghdr *n)
 {
@@ -138,7 +134,7 @@ static int tcindex_print_opt(struct filter_util *qu, FILE *f,
 
                if (RTA_PAYLOAD(tb[TCA_TCINDEX_HASH]) < sizeof(hash))
                        return -1;
-               hash = *(__u16 *) RTA_DATA(tb[TCA_TCINDEX_HASH]);
+               hash = rta_getattr_u16(tb[TCA_TCINDEX_HASH]);
                fprintf(f,"hash %d ",hash);
        }
        if (tb[TCA_TCINDEX_MASK]) {
@@ -146,7 +142,7 @@ static int tcindex_print_opt(struct filter_util *qu, FILE *f,
 
                if (RTA_PAYLOAD(tb[TCA_TCINDEX_MASK]) < sizeof(mask))
                        return -1;
-               mask = *(__u16 *) RTA_DATA(tb[TCA_TCINDEX_MASK]);
+               mask = rta_getattr_u16(tb[TCA_TCINDEX_MASK]);
                fprintf(f,"mask 0x%04x ",mask);
        }
        if (tb[TCA_TCINDEX_SHIFT]) {