From: Vincent Bernat Date: Tue, 13 Aug 2013 19:34:19 +0000 (+0200) Subject: lldpd: small optimization in the expiration process X-Git-Tag: 0.7.7~26 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=42ea638d61b5132da4e821ebca17cb018a54e447;p=thirdparty%2Flldpd.git lldpd: small optimization in the expiration process Don't check if we have to expire a port if we will remove it anyway. --- 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++;