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.

Submitted by:   hselasky@
Approved by:    hselasky (mentor)
MFC after:      1 week
Sponsored by:   Mellanox Technologies
This commit is contained in:
Slava Shwartsman 2018-12-05 13:25:13 +00:00
parent a9c20af23d
commit e13619b68b
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=341534

View File

@ -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) {