From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934406Ab3BSVpc (ORCPT ); Tue, 19 Feb 2013 16:45:32 -0500 Received: from hosting.visp.net.lb ([194.146.153.11]:45390 "EHLO hosting.visp.net.lb" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933545Ab3BSVpa (ORCPT ); Tue, 19 Feb 2013 16:45:30 -0500 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Date: Tue, 19 Feb 2013 23:45:25 +0200 From: Denys Fedoryshchenko To: , , , , Subject: netlink, =?UTF-8?Q?RTM=5FNEWTCLASS=2C=20nested=20attributes?= Message-ID: <3a8fd12d117d2281ac90cce96c0d68f3@visp.net.lb> User-Agent: VISP Webmail/0.8.1 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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? Thank you for your attention. --- Denys Fedoryshchenko, Network Engineer, Virtual ISP S.A.L.