diff options
author | Slava Shwartsman <slavash@FreeBSD.org> | 2018-06-17 07:08:47 +0000 |
---|---|---|
committer | Slava Shwartsman <slavash@FreeBSD.org> | 2018-06-17 07:08:47 +0000 |
commit | cd9cc48b9affbd920825c1b2d26a1eae151249b8 (patch) | |
tree | 5e8f3e7ef16502ddfb91a5008352e4a5bd5c0caf /contrib/ofed | |
parent | 5164504a9ea522a54309414ea6166d96108553e1 (diff) | |
download | src-cd9cc48b9affbd920825c1b2d26a1eae151249b8.tar.gz src-cd9cc48b9affbd920825c1b2d26a1eae151249b8.zip |
Fix false positive on failure
When running mckey, errors may happen in the init/connect stage.
When leaving multicast groups, we override this value.
Fix that by saving the return value from rdma_leave_multicast to different
parameter, and only in case of failure in rdma_leave_multicast override it.
MFC after: 1 week
Approved by: hselasky (mentor), kib (mentor)
Sponsored by: Mellanox Technologies
Notes
Notes:
svn path=/head/; revision=335282
Diffstat (limited to 'contrib/ofed')
-rw-r--r-- | contrib/ofed/librdmacm/examples/mckey.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/contrib/ofed/librdmacm/examples/mckey.c b/contrib/ofed/librdmacm/examples/mckey.c index 60cf8a2408a4..b39a2e0c9371 100644 --- a/contrib/ofed/librdmacm/examples/mckey.c +++ b/contrib/ofed/librdmacm/examples/mckey.c @@ -475,7 +475,7 @@ static int get_dst_addr(char *dst, struct sockaddr *addr) static int run(void) { - int i, ret; + int i, ret, err; printf("mckey: starting %s\n", is_sender ? "client" : "server"); if (src_addr) { @@ -543,10 +543,12 @@ static int run(void) } out: for (i = 0; i < connections; i++) { - ret = rdma_leave_multicast(test.nodes[i].cma_id, + err = rdma_leave_multicast(test.nodes[i].cma_id, test.dst_addr); - if (ret) + if (err) { perror("mckey: failure leaving"); + ret = err; + } } return ret; } |