From 902a165f674c42d1817d9e19ba8a4ef7c72698e5 Mon Sep 17 00:00:00 2001 From: Hans Petter Selasky Date: Thu, 9 Nov 2017 19:30:10 +0000 Subject: [PATCH] Make sure sin_zero is zero in ibcore. Else socket address maching using bcmp() might fail. Sponsored by: Mellanox Technologies MFC after: 1 week --- sys/ofed/drivers/infiniband/core/cma.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sys/ofed/drivers/infiniband/core/cma.c b/sys/ofed/drivers/infiniband/core/cma.c index b8a23f64f917..39802afb96dd 100644 --- a/sys/ofed/drivers/infiniband/core/cma.c +++ b/sys/ofed/drivers/infiniband/core/cma.c @@ -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;