[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAHv+uoHnmsT3jg0EgQhhx4oMrpgpd5LSUz0YyLWJQ4q4DWSX5A@mail.gmail.com>
Date: Mon, 20 Jan 2020 00:46:46 +0530
From: Leslie Monis <lesliemonis@...il.com>
To: David Ahern <dsahern@...il.com>
Cc: Linux NetDev <netdev@...r.kernel.org>,
Stephen Hemminger <stephen@...workplumber.org>
Subject: Re: [PATCH] tc: parse attributes with NLA_F_NESTED flag
On Sun, Jan 19, 2020 at 1:12 PM Leslie Monis <lesliemonis@...il.com> wrote:
>
> On Sun, Jan 19, 2020 at 3:31 AM David Ahern <dsahern@...il.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.
Powered by blists - more mailing lists