]> git.proxmox.com Git - mirror_iproute2.git/commitdiff
Use parse_rtattr_nested
author8!tgraf <8!tgraf>
Tue, 18 Jan 2005 22:11:58 +0000 (22:11 +0000)
committer8!tgraf <8!tgraf>
Tue, 18 Jan 2005 22:11:58 +0000 (22:11 +0000)
(Logical change 1.129)

tc/f_u32.c
tc/m_action.c
tc/q_hfsc.c

index 118225dc05bce503232fb9255d5f4a99746a2484..50dc4dfdcadcebb5ac74e0fbdb324d261910cd4b 100644 (file)
@@ -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);
index c640bebeab62d16cc0411fb8eb40f31a81842107..0e7cfde28450ca3e413d00c21b7fae64ee1702bf 100644 (file)
@@ -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]) {
index 577ffe75a0359b1751e6721e460328eb6c95ebb3..f09c60672a33dd00e35033f8c72658dceea97db8 100644 (file)
@@ -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))