[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <5298503C.6080100@6wind.com>
Date: Fri, 29 Nov 2013 09:28:44 +0100
From: Nicolas Dichtel <nicolas.dichtel@...nd.com>
To: Thomas Graf <tgraf@...g.ch>
CC: davem@...emloft.net, netdev@...r.kernel.org,
"Samuel.gauthier@...nd.com" <Samuel.gauthier@...nd.com>
Subject: Re: [PATCH net] diag: fix netlink API attributes
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@...g.ch>
>>>> Signed-off-by: Nicolas Dichtel <nicolas.dichtel@...nd.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@...g.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@...nd.com>
> Signed-off-by: Thomas Graf <tgraf@...g.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@...nd.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@...nd.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
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists