The initial value of min_refresh() can only matter if there are no remotes,
in which case there is nothing to refresh anyhow. So avoid the magic
number "10" as the initial minimum, since it has no real significance.
Suggested-by: Justin Pettit <jpettit@nicira.com>
{
struct in_band_remote *r;
bool any_changes;
{
struct in_band_remote *r;
bool any_changes;
if (time_now() < ib->next_remote_refresh) {
return false;
}
any_changes = false;
if (time_now() < ib->next_remote_refresh) {
return false;
}
any_changes = false;
+ ib->next_remote_refresh = TIME_MAX;
for (r = ib->remotes; r < &ib->remotes[ib->n_remotes]; r++) {
uint8_t old_remote_mac[ETH_ADDR_LEN];
for (r = ib->remotes; r < &ib->remotes[ib->n_remotes]; r++) {
uint8_t old_remote_mac[ETH_ADDR_LEN];
/* Save old MAC. */
memcpy(old_remote_mac, r->remote_mac, ETH_ADDR_LEN);
/* Refresh remote information. */
/* Save old MAC. */
memcpy(old_remote_mac, r->remote_mac, ETH_ADDR_LEN);
/* Refresh remote information. */
- refresh_interval = refresh_remote(ib, r);
- min_refresh = MIN(min_refresh, refresh_interval);
+ next_refresh = refresh_remote(ib, r) + time_now();
+ ib->next_remote_refresh = MIN(ib->next_remote_refresh, next_refresh);
/* If the MAC changed, log the changes. */
if (!eth_addr_equals(r->remote_mac, old_remote_mac)) {
/* If the MAC changed, log the changes. */
if (!eth_addr_equals(r->remote_mac, old_remote_mac)) {
- ib->next_remote_refresh = time_now() + min_refresh;