public inbox for linux-rdma@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ibacm/acme.c: acm/acme.c: Better error handling in resolve_gid
@ 2012-04-05 20:56 Hal Rosenstock
       [not found] ` <4F7E06E1.1040609-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org>
  0 siblings, 1 reply; 2+ messages in thread
From: Hal Rosenstock @ 2012-04-05 20:56 UTC (permalink / raw)
  To: Hefty, Sean
  Cc: linux-rdma (linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org)


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 <hal-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
---
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 majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* RE: [PATCH] ibacm/acme.c: acm/acme.c: Better error handling in resolve_gid
       [not found] ` <4F7E06E1.1040609-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org>
@ 2012-04-05 23:33   ` Hefty, Sean
  0 siblings, 0 replies; 2+ messages in thread
From: Hefty, Sean @ 2012-04-05 23:33 UTC (permalink / raw)
  To: Hal Rosenstock
  Cc: linux-rdma (linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org)

applied

Thanks for the changes!
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2012-04-05 23:33 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-04-05 20:56 [PATCH] ibacm/acme.c: acm/acme.c: Better error handling in resolve_gid Hal Rosenstock
     [not found] ` <4F7E06E1.1040609-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org>
2012-04-05 23:33   ` Hefty, Sean

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox