From 4442b8fd7d27ab1c261192511b022acf0fdc541d Mon Sep 17 00:00:00 2001 From: hselasky Date: Thu, 21 Apr 2016 16:04:58 +0000 Subject: [PATCH] Fix for resolving mac address when the destination address is a gateway. Remove some dead code while at it. Sponsored by: Mellanox Technologies MFC after: 1 week --- sys/ofed/drivers/infiniband/core/addr.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/sys/ofed/drivers/infiniband/core/addr.c b/sys/ofed/drivers/infiniband/core/addr.c index 27ad05e9c5cf..7992baeb911f 100644 --- a/sys/ofed/drivers/infiniband/core/addr.c +++ b/sys/ofed/drivers/infiniband/core/addr.c @@ -333,17 +333,18 @@ static int addr_resolve(struct sockaddr *src_in, switch (dst_in->sa_family) { #ifdef INET case AF_INET: - error = arpresolve(ifp, is_gw, NULL, dst_in, edst, NULL); + error = arpresolve(ifp, is_gw, NULL, + is_gw ? rte->rt_gateway : dst_in, edst, NULL); break; #endif #ifdef INET6 case AF_INET6: - error = nd6_resolve(ifp, is_gw, NULL, dst_in, edst, NULL); + error = nd6_resolve(ifp, is_gw, NULL, + is_gw ? rte->rt_gateway : dst_in, edst, NULL); break; #endif default: - /* XXX: Shouldn't happen. */ - error = -EINVAL; + break; } RTFREE(rte); if (error == 0) {