public inbox for netdev@vger.kernel.org 
 help / color / mirror / Atom feed
From: Nicolas Dichtel <nicolas.dichtel@6wind•com>
To: Thomas Graf <tgraf@suug•ch>
Cc: davem@davemloft•net, netdev@vger•kernel.org,
	"Samuel.gauthier@6wind•com" <Samuel.gauthier@6wind•com>
Subject: Re: [PATCH net] diag: fix netlink API attributes
Date: Fri, 29 Nov 2013 09:28:44 +0100	[thread overview]
Message-ID: <5298503C.6080100@6wind.com> (raw)
In-Reply-To: <20131128221916.GB4100@casper.infradead.org>

Le 28/11/2013 23:19, Thomas Graf a écrit :
> On 11/28/13 at 06:37pm, Nicolas Dichtel wrote:
>> Le 28/11/2013 17:38, Thomas Graf a écrit :
>>> On 11/28/13 at 02:57pm, Nicolas Dichtel wrote:
>>>> The first netlink attribute (value 0) must always be defined as none/unspec.
>>>> This is correctly done in inet_diag.h, but other diag interfaces are broken.
>>>>
>>>> Libraries like libnl skip this kind of attributes, thus it's never reported to
>>>> the application.
>>>>
>>>> CC: Thomas Graf <tgraf@suug•ch>
>>>> Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind•com>
>>>
>>> First of all, thanks for the notification Nicolas. I'll fix libnl to
>>> pass through these attributes.
>> Fine :)
>> Thank you!
>
> Fixed in:
>
> commit 6a8d90f5fec48b6e376ff29ccf3e0c620a41e758
> Author: Thomas Graf <tgraf@suug•ch>
> Date:   Thu Nov 28 23:14:38 2013 +0100
>
>      attr: Allow attribute type 0
>
>      {netlink,packet,unix}_diag use attribute type 0 for valid
>      attributes. The value was reserved and usage was prohibited
>      by the protocol but we can't undo the breakge.
>
>      Make libnl accept attribute type 0 to allow parsing these
>      attributes.
>
>      Reported-by: Nicolas Dichtel <nicolas.dichtel@6wind•com>
>      Signed-off-by: Thomas Graf <tgraf@suug•ch>
I think the following patch is also needed (not based on HEAD):

 From 8aa4397d43fbd34deea9ed11677c04b460895f15 Mon Sep 17 00:00:00 2001
From: Samuel Gauthier <samuel.gauthier@6wind•com>
Date: Fri, 29 Nov 2013 09:15:34 +0100
Subject: [PATCH] attr: Allow attribute type 0 parsing

The commit 6a8d90f5fec4 "attr: Allow attribute type 0" intended to
allow the parsing of {netlink,packet,unix}_diag, even if they are
using type 0 for valid attributes.

It lacked this part in nla_parse.

Signed-off-by: Samuel Gauthier <samuel.gauthier@6wind•com>
---
  lib/attr.c | 4 ----
  1 file changed, 4 deletions(-)

diff --git a/lib/attr.c b/lib/attr.c
index 535f10c..1e2d57f 100644
--- a/lib/attr.c
+++ b/lib/attr.c
@@ -250,10 +250,6 @@ int nla_parse(struct nlattr *tb[], int maxtype, struct 
nlattr *head, int len,
  	nla_for_each_attr(nla, head, len, rem) {
  		int type = nla_type(nla);

-		/* Padding attributes */
-		if (type == 0)
-			continue;
-
  		if (type > maxtype)
  			continue;

-- 
1.8.0

  reply	other threads:[~2013-11-29  8:28 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-28 13:57 [PATCH net] diag: fix netlink API attributes Nicolas Dichtel
2013-11-28 16:38 ` Thomas Graf
2013-11-28 17:31   ` [RFC PATCH v2] diag: warn about missing first netlink attribute Nicolas Dichtel
2013-11-28 21:36     ` David Miller
2013-11-28 22:09     ` Thomas Graf
2013-11-28 23:16       ` David Miller
2013-11-28 17:37   ` [PATCH net] diag: fix netlink API attributes Nicolas Dichtel
2013-11-28 22:19     ` Thomas Graf
2013-11-29  8:28       ` Nicolas Dichtel [this message]
2013-11-29  8:42         ` Thomas Graf

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=5298503C.6080100@6wind.com \
    --to=nicolas.dichtel@6wind$(echo .)com \
    --cc=Samuel.gauthier@6wind$(echo .)com \
    --cc=davem@davemloft$(echo .)net \
    --cc=netdev@vger$(echo .)kernel.org \
    --cc=tgraf@suug$(echo .)ch \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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