[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20130220152130.72df1258@samsung-9>
Date: Wed, 20 Feb 2013 15:21:30 -0800
From: Stephen Hemminger <stephen@...workplumber.org>
To: Denys Fedoryshchenko <denys@...p.net.lb>
Cc: <netdev@...r.kernel.org>, <pablo@...filter.org>,
<jhs@...atatu.com>, <davem@...emloft.net>,
<linux-kernel@...r.kernel.org>
Subject: Re: netlink, RTM_NEWTCLASS, nested attributes
On Tue, 19 Feb 2013 23:45:25 +0200
Denys Fedoryshchenko <denys@...p.net.lb> wrote:
> Hi
>
> I tried recently to write my own tool based on amazing libmnl (which
> makes understanding of netlink - easy), written
> by Pablo Neira Ayuso, to manage QoS in Linux and faced problem, which i
> think probably
> a bug in handling netlink messages in kernel.
>
> For example if i send message, RTM_NEWTCLASS, after attribute
> TCA_OPTIONS i have nested attributes,
> for example in HTB: TCA_HTB_PARMS, TCA_HTB_RTAB, TCA_HTB_CTAB.
> libmnl, if i use nested attribute, adding a bit to it, by OR -
> NLA_F_NESTED(1 << 15).
> If i remove this flag - everything works fine. And here is the case,
> iproute2 tools
> just update length of TCA_OPTIONS, without setting flag, and it works
> because of that fine too.
>
> So there is basically 3 solutions:
> 1)New function in libmnl to do nested attributes without setting by OR
> flag
> 2)AND-ing attribute type in kernel to ignore nested flag
> 3)Keeping as is, who cares?
>
Several legacy netlink interfaces don't use NESTED flag. These are by
now enshrined in ABI and can't change. In code, that uses libmnl, I just
manually clear the flag as needed and document why. This could
be added to libmnl.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists