From 42ea638d61b5132da4e821ebca17cb018a54e447 Mon Sep 17 00:00:00 2001 From: Vincent Bernat Date: Tue, 13 Aug 2013 21:34:19 +0200 Subject: [PATCH] lldpd: small optimization in the expiration process Don't check if we have to expire a port if we will remove it anyway. --- src/lldpd-structs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lldpd-structs.c b/src/lldpd-structs.c index 58577f3d..376da989 100644 --- a/src/lldpd-structs.c +++ b/src/lldpd-structs.c @@ -123,7 +123,7 @@ lldpd_remote_cleanup(struct lldpd_hardware *hardware, port = port_next) { port_next = TAILQ_NEXT(port, p_entries); del = all; - if (expire && + if (!all && expire && (now - port->p_lastupdate >= port->p_chassis->c_ttl)) { hardware->h_ageout_cnt++; hardware->h_delete_cnt++; -- 2.39.5