From: Leslie Monis <lesliemonis@gmail.com>
To: David Ahern <dsahern@gmail.com>
Cc: Linux NetDev <netdev@vger.kernel.org>,
Stephen Hemminger <stephen@networkplumber.org>
Subject: Re: [PATCH] tc: parse attributes with NLA_F_NESTED flag
Date: Mon, 20 Jan 2020 00:46:46 +0530 [thread overview]
Message-ID: <CAHv+uoHnmsT3jg0EgQhhx4oMrpgpd5LSUz0YyLWJQ4q4DWSX5A@mail.gmail.com> (raw)
In-Reply-To: <CAHv+uoEYa=xNQDLz+-fxnSReSLYX8-ELY8wi4u9Gaa8Qm3h=4w@mail.gmail.com>
On Sun, Jan 19, 2020 at 1:12 PM Leslie Monis <lesliemonis@gmail.com> wrote:
>
> On Sun, Jan 19, 2020 at 3:31 AM David Ahern <dsahern@gmail.com> wrote:
> >
> > On 1/16/20 8:57 AM, Leslie Monis wrote:
> >
> > > diff --git a/tc/tc_class.c b/tc/tc_class.c
> > > index c7e3cfdf..39bea971 100644
> > > --- a/tc/tc_class.c
> > > +++ b/tc/tc_class.c
> > > @@ -246,8 +246,8 @@ static void graph_cls_show(FILE *fp, char *buf, struct hlist_head *root_list,
> > > "+---(%s)", cls_id_str);
> > > strcat(buf, str);
> > >
> > > - parse_rtattr(tb, TCA_MAX, (struct rtattr *)cls->data,
> > > - cls->data_len);
> > > + parse_rtattr_flags(tb, TCA_MAX, (struct rtattr *)cls->data,
> > > + cls->data_len, NLA_F_NESTED);
> >
> > Petr recently sent a patch to update parse_rtattr_nested to add the
> > NESTED flag. Can you update this patch to use parse_rtattr_nested?
>
> Yes, will do.
On a second thought, I think this patch should suffice. Using
parse_rtattr_nested
does not work in this case as the object that is being parsed is not a nested
attribute, but a set of attributes placed contiguously in memory.
If I'm not mistaken, Petr's patch allows parsing nested attributes
(with the NLA_F_NESTED flag set) within a nested attribute.
Adding the NLA_F_NESTED flag to parse_rtattr_flags() enables the function
to correctly parse those attributes (among the set of attributes) that happen to
have the NLA_F_NESTED flag set.
Hope I'm making sense.
next prev parent reply other threads:[~2020-01-19 19:17 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-01-16 15:57 [PATCH] tc: parse attributes with NLA_F_NESTED flag Leslie Monis
2020-01-16 16:01 ` Leslie Monis
2020-01-18 22:01 ` David Ahern
2020-01-19 7:42 ` Leslie Monis
2020-01-19 19:16 ` Leslie Monis [this message]
2020-01-22 3:46 ` David Ahern
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CAHv+uoHnmsT3jg0EgQhhx4oMrpgpd5LSUz0YyLWJQ4q4DWSX5A@mail.gmail.com \
--to=lesliemonis@gmail.com \
--cc=dsahern@gmail.com \
--cc=netdev@vger.kernel.org \
--cc=stephen@networkplumber.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).