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
_______________________________________________
[email protected] mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "[email protected]"

Reply via email to