Netdev List
 help / color / mirror / Atom feed
From: Stephen Hemminger <stephen@networkplumber.org>
To: Denys Fedoryshchenko <denys@visp.net.lb>
Cc: <netdev@vger.kernel.org>, <pablo@netfilter.org>,
	<jhs@mojatatu.com>, <davem@davemloft.net>,
	<linux-kernel@vger.kernel.org>
Subject: Re: netlink, RTM_NEWTCLASS, nested attributes
Date: Wed, 20 Feb 2013 15:21:30 -0800	[thread overview]
Message-ID: <20130220152130.72df1258@samsung-9> (raw)
In-Reply-To: <3a8fd12d117d2281ac90cce96c0d68f3@visp.net.lb>

On Tue, 19 Feb 2013 23:45:25 +0200
Denys Fedoryshchenko <denys@visp.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.

  reply	other threads:[~2013-02-20 23:21 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-02-19 21:45 netlink, RTM_NEWTCLASS, nested attributes Denys Fedoryshchenko
2013-02-20 23:21 ` Stephen Hemminger [this message]
2013-02-20 23:24   ` Denys Fedoryshchenko

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=20130220152130.72df1258@samsung-9 \
    --to=stephen@networkplumber.org \
    --cc=davem@davemloft.net \
    --cc=denys@visp.net.lb \
    --cc=jhs@mojatatu.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pablo@netfilter.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