kernel-netlinks get_interface() considers virtual IPs, too
When using load-tester, we can install tunnel outer addresses on demand. As these are installed as "virtual", we have to consider virtual IPs in the get_interface() lookup to install "real" virtual IPs to these dynamic external addresses.
This commit is contained in:
@@ -1229,6 +1229,19 @@ METHOD(kernel_net_t, get_interface_name, bool,
|
|||||||
this->lock->unlock(this->lock);
|
this->lock->unlock(this->lock);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
/* in a second step, consider virtual IPs installed by us */
|
||||||
|
entry = this->vips->get_match(this->vips, &lookup,
|
||||||
|
(void*)addr_map_entry_match_up_and_usable);
|
||||||
|
if (entry)
|
||||||
|
{
|
||||||
|
if (name)
|
||||||
|
{
|
||||||
|
*name = strdup(entry->iface->ifname);
|
||||||
|
DBG2(DBG_KNL, "virtual %H is on interface %s", ip, *name);
|
||||||
|
}
|
||||||
|
this->lock->unlock(this->lock);
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
/* maybe it is installed on an ignored interface */
|
/* maybe it is installed on an ignored interface */
|
||||||
entry = this->addrs->get_match(this->addrs, &lookup,
|
entry = this->addrs->get_match(this->addrs, &lookup,
|
||||||
(void*)addr_map_entry_match_up);
|
(void*)addr_map_entry_match_up);
|
||||||
|
|||||||
Reference in New Issue
Block a user