From: Stephen Hemminger Date: Fri, 24 Feb 2017 23:24:05 +0000 (-0800) Subject: tc: use rta_getattr_u32 X-Git-Tag: v4.11.0~40 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a59b61620071767046294e918d7d993ef28dd922;p=thirdparty%2Fiproute2.git tc: use rta_getattr_u32 Don't cast RTA_DATA use newish accessors. Signed-off-by: Stephen Hemminger --- diff --git a/tc/f_tcindex.c b/tc/f_tcindex.c index 32bccb0cf..784c89059 100644 --- a/tc/f_tcindex.c +++ b/tc/f_tcindex.c @@ -150,7 +150,7 @@ static int tcindex_print_opt(struct filter_util *qu, FILE *f, if (RTA_PAYLOAD(tb[TCA_TCINDEX_SHIFT]) < sizeof(shift)) return -1; - shift = *(int *) RTA_DATA(tb[TCA_TCINDEX_SHIFT]); + shift = rta_getattr_u32(tb[TCA_TCINDEX_SHIFT]); fprintf(f, "shift %d ", shift); } if (tb[TCA_TCINDEX_FALL_THROUGH]) { @@ -159,7 +159,7 @@ static int tcindex_print_opt(struct filter_util *qu, FILE *f, if (RTA_PAYLOAD(tb[TCA_TCINDEX_FALL_THROUGH]) < sizeof(fall_through)) return -1; - fall_through = *(int *) RTA_DATA(tb[TCA_TCINDEX_FALL_THROUGH]); + fall_through = rta_getattr_u32(tb[TCA_TCINDEX_FALL_THROUGH]); fprintf(f, fall_through ? "fall_through " : "pass_on "); } if (tb[TCA_TCINDEX_CLASSID]) { diff --git a/tc/q_atm.c b/tc/q_atm.c index 01d46a3d4..56e7ad802 100644 --- a/tc/q_atm.c +++ b/tc/q_atm.c @@ -230,7 +230,7 @@ static int atm_print_opt(struct qdisc_util *qu, FILE *f, struct rtattr *opt) if (RTA_PAYLOAD(tb[TCA_ATM_STATE]) < sizeof(state)) fprintf(stderr, "ATM: state field too short\n"); else { - state = *(int *) RTA_DATA(tb[TCA_ATM_STATE]); + state = rta_getattr_u32(tb[TCA_ATM_STATE]); fprintf(f, "%s ", map[state]); } }