diff --git a/tc/f_u32.c b/tc/f_u32.c index 118225dc..50dc4dfd 100644 --- a/tc/f_u32.c +++ b/tc/f_u32.c @@ -956,9 +956,7 @@ static int u32_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_U32_MAX, RTA_DATA(opt), RTA_PAYLOAD(opt)); + parse_rtattr_nested(tb, TCA_U32_MAX, opt); if (handle) { SPRINT_BUF(b1); diff --git a/tc/m_action.c b/tc/m_action.c index c640bebe..0e7cfde2 100644 --- a/tc/m_action.c +++ b/tc/m_action.c @@ -229,8 +229,7 @@ tc_print_one_action(FILE * f, struct rtattr *arg) if (arg == NULL) return -1; - memset(tb, 0, sizeof (tb)); - parse_rtattr(tb, TCA_ACT_MAX, RTA_DATA(arg), RTA_PAYLOAD(arg)); + parse_rtattr_nested(tb, TCA_ACT_MAX, arg); if (tb[TCA_ACT_KIND] == NULL) { fprintf(stderr, "NULL Action!\n"); return -1; @@ -272,8 +271,7 @@ tc_print_action(FILE * f, const struct rtattr *arg) if (arg == NULL) return 0; - memset(tb, 0, sizeof (tb)); - parse_rtattr(tb, TCA_ACT_MAX_PRIO, RTA_DATA(arg), RTA_PAYLOAD(arg)); + parse_rtattr_nested(tb, TCA_ACT_MAX_PRIO, arg); if (tab_flush && NULL != tb[0] && NULL == tb[1]) { int ret = tc_print_one_action(f, tb[0]); @@ -310,7 +308,6 @@ static int do_print_action(const struct sockaddr_nl *who, return -1; } - memset(tb, 0, sizeof(tb)); parse_rtattr(tb, TCAA_MAX, TA_RTA(t), len); if (NULL == tb[TCA_ACT_TAB]) { diff --git a/tc/q_hfsc.c b/tc/q_hfsc.c index 577ffe75..f09c6067 100644 --- a/tc/q_hfsc.c +++ b/tc/q_hfsc.c @@ -239,8 +239,7 @@ hfsc_print_class_opt(struct qdisc_util *qu, FILE *f, struct rtattr *opt) if (opt == NULL) return 0; - memset(tb, 0, sizeof(tb)); - parse_rtattr(tb, TCA_HFSC_MAX, RTA_DATA(opt), RTA_PAYLOAD(opt)); + parse_rtattr_nested(tb, TCA_HFSC_MAX, opt); if (tb[TCA_HFSC_RSC]) { if (RTA_PAYLOAD(tb[TCA_HFSC_RSC]) < sizeof(*rsc))