svn commit: r321551 - projects/bsd_rdma_4_9/sys/contrib/rdma/krping

Hans Petter Selasky hselasky at FreeBSD.org
Wed Jul 26 16:44:25 UTC 2017


Author: hselasky
Date: Wed Jul 26 16:44:24 2017
New Revision: 321551
URL: https://svnweb.freebsd.org/changeset/base/321551

Log:
  Set length of socket address in krping(). Else sobind() will fail with EINVAL.
  
  Submitted by:	Chelsio
  Sponsored by:	Mellanox Technologies

Modified:
  projects/bsd_rdma_4_9/sys/contrib/rdma/krping/krping.c

Modified: projects/bsd_rdma_4_9/sys/contrib/rdma/krping/krping.c
==============================================================================
--- projects/bsd_rdma_4_9/sys/contrib/rdma/krping/krping.c	Wed Jul 26 16:44:08 2017	(r321550)
+++ projects/bsd_rdma_4_9/sys/contrib/rdma/krping/krping.c	Wed Jul 26 16:44:24 2017	(r321551)
@@ -1375,11 +1375,13 @@ static void fill_sockaddr(struct sockaddr_storage *sin
 
 	if (cb->addr_type == AF_INET) {
 		struct sockaddr_in *sin4 = (struct sockaddr_in *)sin;
+		sin4->sin_len = sizeof(*sin4);
 		sin4->sin_family = AF_INET;
 		memcpy((void *)&sin4->sin_addr.s_addr, cb->addr, 4);
 		sin4->sin_port = cb->port;
 	} else if (cb->addr_type == AF_INET6) {
 		struct sockaddr_in6 *sin6 = (struct sockaddr_in6 *)sin;
+		sin6->sin6_len = sizeof(*sin6);
 		sin6->sin6_family = AF_INET6;
 		memcpy((void *)&sin6->sin6_addr, cb->addr, 16);
 		sin6->sin6_port = cb->port;


More information about the svn-src-projects mailing list