summaryrefslogtreecommitdiffstats
path: root/tc
diff options
context:
space:
mode:
author8!tgraf <8!tgraf>2005-01-18 22:11:58 +0000
committer8!tgraf <8!tgraf>2005-01-18 22:11:58 +0000
commitac2fc2df5e117f6bf20d823f4bf1d9390ffbedf4 (patch)
treebac51ee2cf472ff53884da0561b9c0fae658e0ad /tc
parent2af5c3d34463b2a96cebe9de35e86b19b8003011 (diff)
Use parse_rtattr_nested
(Logical change 1.129)
Diffstat (limited to 'tc')
-rw-r--r--tc/f_u32.c4
-rw-r--r--tc/m_action.c7
-rw-r--r--tc/q_hfsc.c3
3 files changed, 4 insertions, 10 deletions
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))