remote ports on ttl expiry.
Problem:
- ttl expires, cleanup check fails to detect that ttl has elapsed
and skips cleanup
- After that, The ttl timer set routine again ends up setting the timer to ttl
resulting in 2 * ttl time for the expired rport to get released
(The test I did was with 1 port)
TAILQ_FOREACH(hardware, &cfg->g_hardware, h_entries) {
TAILQ_FOREACH(port, &hardware->h_rports, p_entries) {
next = port->p_chassis->c_ttl - (now - port->p_lastupdate);
- if (next > 0 && next < tv.tv_sec)
+ if (next >= 0 && next < tv.tv_sec)
tv.tv_sec = next;
}
}
port_next = TAILQ_NEXT(port, p_entries);
del = (expire == NULL);
if (expire &&
- (now - port->p_lastupdate > port->p_chassis->c_ttl)) {
+ (now - port->p_lastupdate >= port->p_chassis->c_ttl)) {
hardware->h_ageout_cnt++;
hardware->h_delete_cnt++;
expire(hardware, port);