Make sure sin_zero is zero in ibcore. Else socket address maching using

bcmp() might fail.

Sponsored by:	Mellanox Technologies
MFC after:	1 week
This commit is contained in:
Hans Petter Selasky 2017-11-09 19:30:10 +00:00
parent cee98bee7d
commit 902a165f67

View File

@ -961,12 +961,14 @@ static void cma_save_net_info(struct rdma_addr *addr,
ip4->sin_addr.s_addr = dst->ip4.addr;
ip4->sin_port = listen4->sin_port;
ip4->sin_len = sizeof(struct sockaddr_in);
memset(ip4->sin_zero, 0, sizeof(ip4->sin_zero));
ip4 = (struct sockaddr_in *) &addr->dst_addr;
ip4->sin_family = listen4->sin_family;
ip4->sin_addr.s_addr = src->ip4.addr;
ip4->sin_port = port;
ip4->sin_len = sizeof(struct sockaddr_in);
memset(ip4->sin_zero, 0, sizeof(ip4->sin_zero));
break;
case 6:
listen6 = (struct sockaddr_in6 *) &listen_addr->src_addr;