Skip to contentSkip to conversation

[PATCH iproute2 rdma: Ignore unknown netlink attributes

PATCH Applied Leon Romanovsky 3 participants 4 messages Apr 3, 2018 – Apr 4, 2018

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

From: Leon Romanovsky <[email protected]>

The check if netlink attributes supplied more than maximum supported is to strict and may lead to backward compatibility issues with old application with a newer kernel that supports new attribute.

CC Steve Wise <[email protected]>
Fixes 74bd75c2b68d ("rdma: Add basic infrastructure for RDMA tool")
---
 rdma/utils.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
rdma/utils.c +2 -1
index a2e08e91..5c1e736a 100644
@@ -399,7 +399,8 @@ int rd_attr_cb(const struct nlattr *attr, void *data)
 	int type;
 
 	if (mnl_attr_type_valid(attr, RDMA_NLDEV_ATTR_MAX) < 0)
-		return MNL_CB_ERROR;
+		/* We received uknown attribute */
+		return MNL_CB_OK;
 
 	type = mnl_attr_get_type(attr);
Reviewed-by
#1 lore raw
Quoted 30 lines

-----Original Message-----
From: Leon Romanovsky <[email protected]>
Sent: Tuesday, April 3, 2018 2:29 AM
To: Stephen Hemminger <[email protected]>
Cc: Leon Romanovsky <[email protected]>; netdev <[email protected]>; RDMA mailing list <linux- [email protected]>; David Ahern <[email protected]>; Steve Wise <[email protected]>
Subject: [PATCH iproute2 rdma: Ignore unknown netlink attributes

From: Leon Romanovsky <[email protected]>

The check if netlink attributes supplied more than maximum supported is to strict and may lead to backward compatibility issues with old application with a newer kernel that supports new attribute.

CC Steve Wise <[email protected]>
Fixes 74bd75c2b68d ("rdma: Add basic infrastructure for RDMA tool")
---
 rdma/utils.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
rdma/utils.c +0 -0
index a2e08e91..5c1e736a 100644

rdma/utils.c int rd_attr_cb(const struct nlattr *attr, void *data) · line 406

Quoted 9 lines
rdma/utils.c +2 -1
@@ -399,7 +399,8 @@ int rd_attr_cb(const struct nlattr *attr, void *data)
 	int type;
 
 	if (mnl_attr_type_valid(attr, RDMA_NLDEV_ATTR_MAX) < 0)
-		return MNL_CB_ERROR;
+		/* We received uknown attribute */
+		return MNL_CB_OK;
 
 	type = mnl_attr_get_type(attr);
 

Hey Leon,

So the resource parsing functions correctly ignore the unkown attrs and print everything else?

Looks good.

#2 lore raw
Quoted 37 lines · Steve Wise
Quoted 37 lines

-----Original Message-----
From: Leon Romanovsky <[email protected]>
Sent: Tuesday, April 3, 2018 2:29 AM
To: Stephen Hemminger <[email protected]>
Cc: Leon Romanovsky <[email protected]>; netdev <[email protected]>; RDMA mailing list <linux- [email protected]>; David Ahern <[email protected]>; Steve Wise <[email protected]>
Subject: [PATCH iproute2 rdma: Ignore unknown netlink attributes

From: Leon Romanovsky <[email protected]>

The check if netlink attributes supplied more than maximum supported is to strict and may lead to backward compatibility issues with old application with a newer kernel that supports new attribute.

CC Steve Wise <[email protected]>
Fixes 74bd75c2b68d ("rdma: Add basic infrastructure for RDMA tool")
---
 rdma/utils.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
rdma/utils.c +2 -1
index a2e08e91..5c1e736a 100644
@@ -399,7 +399,8 @@ int rd_attr_cb(const struct nlattr *attr, void *data)
 	int type;
 
 	if (mnl_attr_type_valid(attr, RDMA_NLDEV_ATTR_MAX) < 0)
-		return MNL_CB_ERROR;
+		/* We received uknown attribute */
+		return MNL_CB_OK;
 
Quoted 7 lines

rdma/utils.c int rd_attr_cb(const struct nlattr *attr, void *data) · line 406

Quoted 2 lines
rdma/utils.c +0 -0
 	type = mnl_attr_get_type(attr);
 

Hey Leon,

So the resource parsing functions correctly ignore the unkown attrs and print everything else?

Yes.

Quoted 5 lines

Looks good.

Thanks a lot.

#3 lore raw
In reply to Leon Romanovsky
Quoted 9 lines · On Tue, 3 Apr 2018 10:28:42 +0300 Leon Romanovsky <[email protected]> wrote:

From: Leon Romanovsky <[email protected]>

The check if netlink attributes supplied more than maximum supported is to strict and may lead to backward compatibility issues with old application with a newer kernel that supports new attribute.

CC Steve Wise <[email protected]>
Fixes 74bd75c2b68d ("rdma: Add basic infrastructure for RDMA tool")

Applied