From patchwork Wed Jan 22 01:15:13 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Al Chu X-Patchwork-Id: 3521321 X-Patchwork-Delegate: ira.weiny@intel.com Return-Path: X-Original-To: patchwork-linux-rdma@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 94A829F2D6 for ; Wed, 22 Jan 2014 01:15:30 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id A5F192013A for ; Wed, 22 Jan 2014 01:15:29 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 990FC20122 for ; Wed, 22 Jan 2014 01:15:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752690AbaAVBPP (ORCPT ); Tue, 21 Jan 2014 20:15:15 -0500 Received: from prdiron-1.llnl.gov ([128.15.143.171]:43375 "EHLO prdiron-1.llnl.gov" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750862AbaAVBPO (ORCPT ); Tue, 21 Jan 2014 20:15:14 -0500 X-Attachments: Received: from auk59.llnl.gov (HELO [134.9.93.24]) ([134.9.93.24]) by prdiron-1.llnl.gov with ESMTP; 21 Jan 2014 17:15:13 -0800 Subject: [PATCH] infiniband-diags: Check node-name-map strings when querying by name From: Albert Chu To: linux-rdma@vger.kernel.org Date: Tue, 21 Jan 2014 17:15:13 -0800 Message-Id: <1390353313.6153.358.camel@auk59.llnl.gov> Mime-Version: 1.0 X-Mailer: Evolution 2.12.3 (2.12.3-19.el5) Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org X-Spam-Status: No, score=-7.5 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Signed-off-by: Albert L. Chu --- src/saquery.c | 14 ++++++++++++++ 1 files changed, 14 insertions(+), 0 deletions(-) diff --git a/src/saquery.c b/src/saquery.c index d6fd017..837d8ae 100644 --- a/src/saquery.c +++ b/src/saquery.c @@ -1010,10 +1010,22 @@ static int print_node_records(struct sa_handle * h, struct query_params *p) if (requested_guid == cl_ntoh64(p_ni->port_guid)) print_node_record(node_record); } else { + ib_node_info_t *p_ni = &(node_record->node_info); + ib_node_desc_t *p_nd = &(node_record->node_desc); + char *name; + + name = remap_node_name (node_name_map, + cl_ntoh64(p_ni->node_guid), + (char *)p_nd->description); + if (!requested_name || (strncmp(requested_name, (char *)node_record->node_desc.description, sizeof(node_record-> + node_desc.description)) == 0) || + (strncmp(requested_name, + name, + sizeof(node_record-> node_desc.description)) == 0)) { print_node_record(node_record); if (node_print_desc == UNIQUE_LID_ONLY) { @@ -1021,6 +1033,8 @@ static int print_node_records(struct sa_handle * h, struct query_params *p) exit(0); } } + + free(name); } } sa_free_result_mad(&result);