Properly setup arguments for if_resolvemulti() callback.

Sponsored by:	Mellanox Technologies
MFC after:	1 week
This commit is contained in:
Hans Petter Selasky 2016-04-21 11:32:22 +00:00
parent 61a292a396
commit 53219aa88a

View File

@ -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;