This patch improve host detection and refresh when it moves from and
interface to another by pinging for it on all managed interfaces.
Previous to this patch host expiration was done by pinging for it on
the last interface it was known to be. If it does not reply after a
number of retries it will be expired and its entries
deleted. Nevertheless, if the host has moved to another managed
interface it will not be detected until there is some ARP packet sent
by the host.
This detection can be improved by pinging for the host on all managed
interfaces instead of just the one where it is supposed to be
connected, as it will reply to the ARP ping on the new interface it is
connected to and a host refresh will be triggered.
Signed-off-by: Alejandro Enrique <alejandro.enrique@fon.com>
static void host_entry_timeout(struct uloop_timeout *timeout)
{
struct relayd_host *host = container_of(timeout, struct relayd_host, timeout);
+ struct relayd_interface *rif;
/*
* When a host is behind a managed interface, we must not expire its host
* giving up on it.
*/
if (host->rif->managed && host->cleanup_pending < host_ping_tries) {
- send_arp_request(host->rif, host->ipaddr);
+ list_for_each_entry(rif, &interfaces, list) {
+ send_arp_request(rif, host->ipaddr);
+ }
host->cleanup_pending++;
uloop_timeout_set(&host->timeout, 1000);
return;