Hey Sasha,

This patch checks for duplicate port guids in a libibnetdisc cache when
it is loaded and report an error back to the user appropriately.

Al

-- 
Albert Chu
[email protected]
Computer Scientist
High Performance Systems Division
Lawrence Livermore National Laboratory
--- Begin Message ---
Signed-off-by: Albert Chu <[email protected]>
---
 .../libibnetdisc/src/ibnetdisc_cache.c             |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/infiniband-diags/libibnetdisc/src/ibnetdisc_cache.c 
b/infiniband-diags/libibnetdisc/src/ibnetdisc_cache.c
index 2ec353d..a02fcba 100644
--- a/infiniband-diags/libibnetdisc/src/ibnetdisc_cache.c
+++ b/infiniband-diags/libibnetdisc/src/ibnetdisc_cache.c
@@ -505,6 +505,11 @@ static int _fill_port(ibnd_fabric_cache_t * fabric_cache, 
ibnd_node_t * node,
                return -1;
        }
 
+       if (port_cache->port_stored_to_fabric) {
+               IBND_DEBUG("Cache invalid: duplicate port discovered\n");
+               return -1;
+       }
+
        node->ports[port_cache->port->portnum] = port_cache->port;
        port_cache->port_stored_to_fabric++;
 
-- 
1.5.4.5


--- End Message ---

Reply via email to