From 53219aa88a4c32c5900c7d8c2a45589502ef9d4a Mon Sep 17 00:00:00 2001 From: Hans Petter Selasky Date: Thu, 21 Apr 2016 11:32:22 +0000 Subject: [PATCH] Properly setup arguments for if_resolvemulti() callback. Sponsored by: Mellanox Technologies MFC after: 1 week --- sys/ofed/drivers/infiniband/core/addr.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/sys/ofed/drivers/infiniband/core/addr.c b/sys/ofed/drivers/infiniband/core/addr.c index 2a918cb38ade..27ad05e9c5cf 100644 --- a/sys/ofed/drivers/infiniband/core/addr.c +++ b/sys/ofed/drivers/infiniband/core/addr.c @@ -310,13 +310,19 @@ static int addr_resolve(struct sockaddr *src_in, return rdma_copy_addr(addr, ifp, ifp->if_broadcastaddr); if (multi) { struct sockaddr *llsa; + struct sockaddr_dl sdl; + + sdl.sdl_len = sizeof(sdl); + llsa = (struct sockaddr *)&sdl; + + if (ifp->if_resolvemulti == NULL) + return -EOPNOTSUPP; error = ifp->if_resolvemulti(ifp, &llsa, dst_in); if (error) return -error; error = rdma_copy_addr(addr, ifp, LLADDR((struct sockaddr_dl *)llsa)); - free(llsa, M_IFMADDR); if (error == 0) memcpy(src_in, ifa->ifa_addr, ip_addr_size(ifa->ifa_addr)); return error;