Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 27 Mar 2019 19:40:32 +0000 (UTC)
From:      Navdeep Parhar <np@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org
Subject:   svn commit: r345597 - stable/12/contrib/ofed/librdmacm/examples
Message-ID:  <201903271940.x2RJeWnP078493@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: np
Date: Wed Mar 27 19:40:31 2019
New Revision: 345597
URL: https://svnweb.freebsd.org/changeset/base/345597

Log:
  MFC r339886:
  
  rping(1): Make sure the socket address defaults to something reasonable
  when running as the server.
  
  Submitted by:	Krishnamraju Eraparaju @ Chelsio
  Reviewed by:	hselasky@, np@
  Sponsored by:	Chelsio Communications
  Differential Revision:	https://reviews.freebsd.org/D17707

Modified:
  stable/12/contrib/ofed/librdmacm/examples/rping.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/contrib/ofed/librdmacm/examples/rping.c
==============================================================================
--- stable/12/contrib/ofed/librdmacm/examples/rping.c	Wed Mar 27 19:40:18 2019	(r345596)
+++ stable/12/contrib/ofed/librdmacm/examples/rping.c	Wed Mar 27 19:40:31 2019	(r345597)
@@ -1177,9 +1177,13 @@ int main(int argc, char *argv[])
 	cb->server = -1;
 	cb->state = IDLE;
 	cb->size = 64;
-	cb->sin.ss_family = PF_INET;
 	cb->port = htobe16(7174);
 	sem_init(&cb->sem, 0, 0);
+
+	/* initialize sockaddr structure with defaults */
+	ret = get_addr("0.0.0.0", (struct sockaddr *) &cb->sin);
+	if (ret)
+		goto out;
 
 	opterr = 0;
 	while ((op=getopt(argc, argv, "a:I:Pp:C:S:t:scvVd")) != -1) {



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201903271940.x2RJeWnP078493>