|
|
930fb9 |
From 97d754cf27798bc19ccdf8ce6d6b5b878e4d2c25 Mon Sep 17 00:00:00 2001
|
|
|
930fb9 |
From: Phil Sutter <psutter@redhat.com>
|
|
|
930fb9 |
Date: Thu, 25 Oct 2018 12:24:30 +0200
|
|
|
930fb9 |
Subject: [PATCH] rdma: Don't pass garbage to rd_check_is_filtered()
|
|
|
930fb9 |
|
|
|
930fb9 |
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1602555
|
|
|
930fb9 |
Upstream Status: iproute2.git commit cdefe1d8e472f
|
|
|
930fb9 |
|
|
|
930fb9 |
commit cdefe1d8e472f3a69d5f54d90092b9b50961bf91
|
|
|
930fb9 |
Author: Phil Sutter <phil@nwl.cc>
|
|
|
930fb9 |
Date: Thu Oct 18 14:35:50 2018 +0200
|
|
|
930fb9 |
|
|
|
930fb9 |
rdma: Don't pass garbage to rd_check_is_filtered()
|
|
|
930fb9 |
|
|
|
930fb9 |
Variables 'src_port' and 'dst_port' are initialized only if attributes
|
|
|
930fb9 |
RDMA_NLDEV_ATTR_RES_SRC_ADDR or RDMA_NLDEV_ATTR_RES_DST_ADDR are
|
|
|
930fb9 |
present. Make sure to pass them over to rd_check_is_filtered() only if
|
|
|
930fb9 |
that is the case.
|
|
|
930fb9 |
|
|
|
930fb9 |
Fixes: 9a362cc71a455 ("rdma: Add CM_ID resource tracking information")
|
|
|
930fb9 |
Signed-off-by: Phil Sutter <phil@nwl.cc>
|
|
|
930fb9 |
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
|
|
|
930fb9 |
---
|
|
|
930fb9 |
rdma/res.c | 10 ++++------
|
|
|
930fb9 |
1 file changed, 4 insertions(+), 6 deletions(-)
|
|
|
930fb9 |
|
|
|
930fb9 |
diff --git a/rdma/res.c b/rdma/res.c
|
|
|
930fb9 |
index 074b992..0d8c1c3 100644
|
|
|
930fb9 |
--- a/rdma/res.c
|
|
|
930fb9 |
+++ b/rdma/res.c
|
|
|
930fb9 |
@@ -621,6 +621,8 @@ static int res_cm_id_parse_cb(const struct nlmsghdr *nlh, void *data)
|
|
|
930fb9 |
if (rd_check_is_string_filtered(rd, "src-addr",
|
|
|
930fb9 |
src_addr_str))
|
|
|
930fb9 |
continue;
|
|
|
930fb9 |
+ if (rd_check_is_filtered(rd, "src-port", src_port))
|
|
|
930fb9 |
+ continue;
|
|
|
930fb9 |
}
|
|
|
930fb9 |
|
|
|
930fb9 |
if (nla_line[RDMA_NLDEV_ATTR_RES_DST_ADDR]) {
|
|
|
930fb9 |
@@ -630,14 +632,10 @@ static int res_cm_id_parse_cb(const struct nlmsghdr *nlh, void *data)
|
|
|
930fb9 |
if (rd_check_is_string_filtered(rd, "dst-addr",
|
|
|
930fb9 |
dst_addr_str))
|
|
|
930fb9 |
continue;
|
|
|
930fb9 |
+ if (rd_check_is_filtered(rd, "dst-port", dst_port))
|
|
|
930fb9 |
+ continue;
|
|
|
930fb9 |
}
|
|
|
930fb9 |
|
|
|
930fb9 |
- if (rd_check_is_filtered(rd, "src-port", src_port))
|
|
|
930fb9 |
- continue;
|
|
|
930fb9 |
-
|
|
|
930fb9 |
- if (rd_check_is_filtered(rd, "dst-port", dst_port))
|
|
|
930fb9 |
- continue;
|
|
|
930fb9 |
-
|
|
|
930fb9 |
if (nla_line[RDMA_NLDEV_ATTR_RES_PID]) {
|
|
|
930fb9 |
pid = mnl_attr_get_u32(
|
|
|
930fb9 |
nla_line[RDMA_NLDEV_ATTR_RES_PID]);
|
|
|
930fb9 |
--
|
|
|
930fb9 |
1.8.3.1
|
|
|
930fb9 |
|