Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 2 Aug 2018 08:26:56 +0000 (UTC)
From:      Hans Petter Selasky <hselasky@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org
Subject:   svn commit: r337089 - stable/11/sys/ofed/drivers/infiniband/core
Message-ID:  <201808020826.w728QuFd045018@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: hselasky
Date: Thu Aug  2 08:26:56 2018
New Revision: 337089
URL: https://svnweb.freebsd.org/changeset/base/337089

Log:
  MFC r336384:
  Fix for loopback detection in address resolve logic in ibcore.
  
  When a loopback address is detected use the network interface which
  has the loopback flag set to trigger loopback logic in address resolve.
  
  Sponsored by:		Mellanox Technologies

Modified:
  stable/11/sys/ofed/drivers/infiniband/core/ib_addr.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/ofed/drivers/infiniband/core/ib_addr.c
==============================================================================
--- stable/11/sys/ofed/drivers/infiniband/core/ib_addr.c	Thu Aug  2 08:25:48 2018	(r337088)
+++ stable/11/sys/ofed/drivers/infiniband/core/ib_addr.c	Thu Aug  2 08:26:56 2018	(r337089)
@@ -349,6 +349,10 @@ static int addr4_resolve(struct sockaddr_in *src_in,
 				error = EHOSTUNREACH;
 				goto error_put_ifp;
 			}
+			/* get destination network interface from route */
+			dev_put(ifp);
+			ifp = rte->rt_ifp;
+			dev_hold(ifp);
 		} else if (ifp != rte->rt_ifp) {
 			/*
 			 * Source and destination interfaces are
@@ -544,6 +548,10 @@ static int addr6_resolve(struct sockaddr_in6 *src_in,
 				error = EHOSTUNREACH;
 				goto error_put_ifp;
 			}
+			/* get destination network interface from route */
+			dev_put(ifp);
+			ifp = rte->rt_ifp;
+			dev_hold(ifp);
 		} else if (ifp != rte->rt_ifp) {
 			/*
 			 * Source and destination interfaces are



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201808020826.w728QuFd045018>