Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 12 Dec 2018 11:16:32 +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: r341882 - stable/11/sys/ofed/drivers/infiniband/core
Message-ID:  <201812121116.wBCBGWVw041264@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: hselasky
Date: Wed Dec 12 11:16:32 2018
New Revision: 341882
URL: https://svnweb.freebsd.org/changeset/base/341882

Log:
  MFC r341534:
  ibcore: Fix clearing of bound device interface.
  
  Binding to a loopback device is not allowed. Make sure the destination
  device address is global by clearing the bound device interface.
  Only do this conditionally, else link local addresses won't work.
  
  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	Wed Dec 12 11:15:12 2018	(r341881)
+++ stable/11/sys/ofed/drivers/infiniband/core/ib_addr.c	Wed Dec 12 11:16:32 2018	(r341882)
@@ -649,8 +649,13 @@ static int addr_resolve_neigh(struct ifnet *dev,
 	if (dev->if_flags & IFF_LOOPBACK) {
 		int ret;
 
-		/* find real device, not loopback one */
-		addr->bound_dev_if = 0;
+		/*
+		 * Binding to a loopback device is not allowed. Make
+		 * sure the destination device address is global by
+		 * clearing the bound device interface:
+		 */
+		if (addr->bound_dev_if == dev->if_index)
+			addr->bound_dev_if = 0;
 
 		ret = rdma_translate_ip(dst_in, addr);
 		if (ret == 0) {



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