Author: np
Date: Mon Oct 29 21:46:05 2018
New Revision: 339886
URL: https://svnweb.freebsd.org/changeset/base/339886

Log:
  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@
  MFC after:    1 month
  Sponsored by: Chelsio Communications
  Differential Revision:        https://reviews.freebsd.org/D17707

Modified:
  head/contrib/ofed/librdmacm/examples/rping.c

Modified: head/contrib/ofed/librdmacm/examples/rping.c
==============================================================================
--- head/contrib/ofed/librdmacm/examples/rping.c        Mon Oct 29 21:36:10 
2018        (r339885)
+++ head/contrib/ofed/librdmacm/examples/rping.c        Mon Oct 29 21:46:05 
2018        (r339886)
@@ -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) {
_______________________________________________
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to