A return of 0 is an error for inet_pton but if 0 is returned
from resolve_gid, show_path is mistakenly called so if
0 is returned from inet_pton, return -1 instead (which is
what is done elsewhere in acme). 

Signed-off-by: Hal Rosenstock <[email protected]>
---
diff --git a/src/acme.c b/src/acme.c
index 3d7461b..3e5f301 100644
--- a/src/acme.c
+++ b/src/acme.c
@@ -513,13 +513,19 @@ static int resolve_gid(struct ibv_path_record *path)
        ret = inet_pton(AF_INET6, src_addr, &path->sgid);
        if (ret <= 0) {
                printf("inet_pton error on source address (%s): 0x%x\n", 
src_addr, ret);
-               return ret;
+               if (ret)
+                       return ret;
+               else
+                       return -1;
        }
 
        ret = inet_pton(AF_INET6, dest_addr, &path->dgid);
        if (ret <= 0) {
                printf("inet_pton error on dest address (%s): 0x%x\n", 
dest_addr, ret);
-               return ret;
+               if (ret)
+                       return ret;
+               else
+                       return -1;
        }
 
        path->reversible_numpath = IBV_PATH_RECORD_REVERSIBLE | 1;
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to