public inbox for linux-rdma@vger.kernel.org
 help / color / mirror / Atom feed
From: "David J. Wilder" <dwilder-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
To: Sean Hefty <sean.hefty-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
Cc: Jason Gunthorpe
	<jgunthorpe-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>,
	rdreier-FYB4Gu1CFyUAvxtiuMwx3w@public.gmane.org,
	linux-rdma <linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	pradeep-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org,
	ewg-ZwoEplunGu1OwGhvXhtEPSCwEArCW2h5@public.gmane.org
Subject: RE: [PATCH] link-local address fix for rdma_resolve_addr
Date: Tue, 27 Oct 2009 11:22:18 -0700	[thread overview]
Message-ID: <1256667738.16192.1.camel@wilder.ibm.com> (raw)
In-Reply-To: <660D538F30E647F3AE1E5E6C1ACBE882-Zpru7NauK7drdx17CPfAsdBPR1lH4CV8@public.gmane.org>


On Thu, 2009-10-22 at 15:02 -0700, Sean Hefty wrote:
> >For ipv6 I ran what I described previously.  What I do need to do is add
> >the option to rping to specify a source address and run it with various
> >address.  Any help you can give defining what exactly needs to be tested
> >would be appreciated.
> 
> You can also test with ucmatose to verify ipv4 still works.  Use the -b option
> to bind to a specific address.
> 
> - Sean 
> 

Sean
This patch adds ipv6 support to ucmatose.

Signed-off-by: David Wilder <dwilder-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>

------------------------------------------------------
 examples/cmatose.c |   31 +++++++++++++++++++------------
 1 files changed, 19 insertions(+), 12 deletions(-)

diff --git a/examples/cmatose.c b/examples/cmatose.c
index 8c12347..481a6d0 100644
--- a/examples/cmatose.c
+++ b/examples/cmatose.c
@@ -516,15 +516,15 @@ static int get_addr(char *dst, struct sockaddr_in *addr)
 		return ret;
 	}
 
-	if (res->ai_family != PF_INET) {
+	if (res->ai_family == PF_INET)
+		memcpy(addr, res->ai_addr, sizeof(struct sockaddr_in));
+	else if (res->ai_family == PF_INET6)
+		memcpy(addr, res->ai_addr, sizeof(struct sockaddr_in6));
+	else
 		ret = -1;
-		goto out;
-	}
 
-	*addr = *(struct sockaddr_in *) res->ai_addr;
-out:
-	freeaddrinfo(res);
-	return ret;
+        freeaddrinfo(res);
+        return ret;
 }
 
 static int run_server(void)
@@ -543,11 +543,18 @@ static int run_server(void)
 		ret = get_addr(src_addr, &test.src_in);
 		if (ret)
 			goto out;
-	} else
+		if(test.src_in.sin_family == AF_INET)
+			((struct sockaddr_in *) &test.src_in)->sin_port = port;
+		else
+			((struct sockaddr_in6 *) &test.src_in)->sin6_port=port;
+		
+	} else {
 		test.src_in.sin_family = PF_INET;
+		test.src_in.sin_port = port;
+	}
+
+	ret = rdma_bind_addr(listen_id, (struct sockaddr *)&test.src_in);
 
-	test.src_in.sin_port = port;
-	ret = rdma_bind_addr(listen_id, test.src_addr);
 	if (ret) {
 		perror("cmatose: bind address failed");
 		goto out;
@@ -628,8 +635,8 @@ static int run_client(void)
 	printf("cmatose: connecting\n");
 	for (i = 0; i < connections; i++) {
 		ret = rdma_resolve_addr(test.nodes[i].cma_id,
-					src_addr ? test.src_addr : NULL,
-					test.dst_addr, 2000);
+			src_addr ? (struct sockaddr *)&test.src_in : NULL,
+			(struct sockaddr *)&test.dst_in, 2000);
 		if (ret) {
 			perror("cmatose: failure getting addr");
 			connect_error();


--
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

  parent reply	other threads:[~2009-10-27 18:22 UTC|newest]

Thread overview: 44+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-10-19 22:47 [PATCH] link-local address fix for rdma_resolve_addr David J. Wilder
     [not found] ` <1255992430.12075.7.camel-XfwDJb4SXxnMbYB6QlFGEg@public.gmane.org>
2009-10-19 23:43   ` Jason Gunthorpe
     [not found]     ` <20091019234329.GC9643-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
2009-10-19 23:47       ` Sean Hefty
     [not found]         ` <676AB781CD644CC28E1AD4951EA4EEF8-Zpru7NauK7drdx17CPfAsdBPR1lH4CV8@public.gmane.org>
2009-10-20  0:33           ` Jason Gunthorpe
     [not found]             ` <20091020003344.GA14520-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
2009-10-21 22:30               ` David J. Wilder
     [not found]                 ` <1256164230.12075.31.camel-XfwDJb4SXxnMbYB6QlFGEg@public.gmane.org>
2009-10-21 23:08                   ` Jason Gunthorpe
     [not found]                     ` <20091021230845.GR14520-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
2009-10-22 21:12                       ` David J. Wilder
     [not found]                         ` <1256245942.12075.46.camel-XfwDJb4SXxnMbYB6QlFGEg@public.gmane.org>
2009-10-22 22:02                           ` Sean Hefty
     [not found]                             ` <660D538F30E647F3AE1E5E6C1ACBE882-Zpru7NauK7drdx17CPfAsdBPR1lH4CV8@public.gmane.org>
2009-10-27 18:22                               ` David J. Wilder [this message]
     [not found]                                 ` <1256667738.16192.1.camel-XfwDJb4SXxnMbYB6QlFGEg@public.gmane.org>
2009-10-27 18:58                                   ` [PATCH] librdmacm/cmatose: add support for ipv6 Sean Hefty
     [not found]                                     ` <EE6710D62B854E4FBA82524DEB84E8DC-Zpru7NauK7drdx17CPfAsdBPR1lH4CV8@public.gmane.org>
2009-10-27 19:42                                       ` Sean Hefty
2009-10-27 21:50                                       ` David J. Wilder
2009-10-21 23:17                   ` [PATCH] link-local address fix for rdma_resolve_addr Sean Hefty
     [not found]                     ` <9D257695083141E79685CB2B260D7D7C-Zpru7NauK7drdx17CPfAsdBPR1lH4CV8@public.gmane.org>
2009-10-21 23:36                       ` Jason Gunthorpe
     [not found]                         ` <20091021233639.GS14520-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
2009-10-21 23:46                           ` Jason Gunthorpe
2009-10-21 23:58                           ` Sean Hefty
     [not found]                             ` <BFF5CD71FFA74BF09A2EED5F3319F370-Zpru7NauK7drdx17CPfAsdBPR1lH4CV8@public.gmane.org>
2009-10-22  0:28                               ` Jason Gunthorpe
     [not found]                                 ` <20091022002846.GU14520-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
2009-10-22  0:40                                   ` Sean Hefty
     [not found]                                     ` <4803112A5B7A4953B62ABAFD1BBD9881-Zpru7NauK7drdx17CPfAsdBPR1lH4CV8@public.gmane.org>
2009-10-22  1:19                                       ` Jason Gunthorpe
     [not found]                                         ` <20091022011939.GW14520-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
2009-10-22  5:24                                           ` Sean Hefty
     [not found]                                             ` <60E9443821EE4FFA90448DF5CC1368A8-Zpru7NauK7drdx17CPfAsdBPR1lH4CV8@public.gmane.org>
2009-10-22  6:25                                               ` Jason Gunthorpe
     [not found]                                                 ` <20091022062531.GB26003-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
2009-10-22  6:49                                                   ` Sean Hefty
     [not found]                                                     ` <B1D32A650C2F400E92AFC4909D8880A0-Zpru7NauK7drdx17CPfAsdBPR1lH4CV8@public.gmane.org>
2009-10-22 16:47                                                       ` Jason Gunthorpe
     [not found]                                                         ` <20091022164717.GG26003-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
2009-10-22 17:59                                                           ` Sean Hefty
     [not found]                                                             ` <A03920DE5BAE4309BAFC1B6471AE928C-Zpru7NauK7drdx17CPfAsdBPR1lH4CV8@public.gmane.org>
2009-10-22 18:22                                                               ` Jason Gunthorpe
     [not found]                                                                 ` <20091022182221.GZ14520-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
2009-10-22 18:31                                                                   ` Sean Hefty
     [not found]                                                                     ` <60293EE44E7243B59C41498F20D558A0-Zpru7NauK7drdx17CPfAsdBPR1lH4CV8@public.gmane.org>
2009-10-22 18:40                                                                       ` Jason Gunthorpe
2009-10-25 11:52                                                   ` Or Gerlitz
     [not found]                                                     ` <4AE43BED.3090405-smomgflXvOZWk0Htik3J/w@public.gmane.org>
2009-10-25 20:03                                                       ` Jason Gunthorpe
     [not found]                                                         ` <20091025200332.GN26003-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
2009-10-27 13:01                                                           ` Or Gerlitz
     [not found]                                                             ` <4AE6EF44.5040004-smomgflXvOZWk0Htik3J/w@public.gmane.org>
2009-10-27 17:14                                                               ` Jason Gunthorpe
     [not found]                                                                 ` <20091027171403.GP26003-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
2009-10-28 14:33                                                                   ` Or Gerlitz
  -- strict thread matches above, loose matches on Subject: below --
2009-10-13 22:09 David J. Wilder
     [not found] ` <1255471781.14513.7.camel-XfwDJb4SXxnMbYB6QlFGEg@public.gmane.org>
2009-10-13 23:12   ` Jason Gunthorpe
     [not found]     ` <20091013231234.GK5191-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
2009-10-14 16:23       ` David J. Wilder
     [not found]         ` <1255537437.14513.28.camel-XfwDJb4SXxnMbYB6QlFGEg@public.gmane.org>
2009-10-14 17:01           ` Jason Gunthorpe
     [not found]             ` <20091014170155.GL5191-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
2009-10-14 17:30               ` David J. Wilder
     [not found]                 ` <1255541405.5111.14.camel-XfwDJb4SXxnMbYB6QlFGEg@public.gmane.org>
2009-10-14 17:40                   ` Jason Gunthorpe
     [not found]                     ` <20091014174017.GM5191-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
2009-10-15 19:27                       ` David J. Wilder
     [not found]                         ` <1255634841.5111.40.camel-XfwDJb4SXxnMbYB6QlFGEg@public.gmane.org>
2009-10-15 21:32                           ` Jason Gunthorpe
     [not found]                             ` <20091015213205.GV5191-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
2009-10-16 18:54                               ` David J. Wilder
     [not found]                                 ` <1255719280.14675.30.camel-XfwDJb4SXxnMbYB6QlFGEg@public.gmane.org>
2009-10-16 19:28                                   ` Jason Gunthorpe
2009-10-14 19:33               ` David J. Wilder
     [not found]                 ` <1255548798.5111.24.camel-XfwDJb4SXxnMbYB6QlFGEg@public.gmane.org>
2009-10-14 20:09                   ` Jason Gunthorpe

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1256667738.16192.1.camel@wilder.ibm.com \
    --to=dwilder-r/jw6+rmf7hqt0dzr+alfa@public.gmane.org \
    --cc=ewg-ZwoEplunGu1OwGhvXhtEPSCwEArCW2h5@public.gmane.org \
    --cc=jgunthorpe-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org \
    --cc=linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=pradeep-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org \
    --cc=rdreier-FYB4Gu1CFyUAvxtiuMwx3w@public.gmane.org \
    --cc=sean.hefty-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox