]> git.ipfire.org Git - thirdparty/lldpd.git/commitdiff
lldpd: small optimization in the expiration process
authorVincent Bernat <bernat@luffy.cx>
Tue, 13 Aug 2013 19:34:19 +0000 (21:34 +0200)
committerVincent Bernat <bernat@luffy.cx>
Tue, 13 Aug 2013 19:34:19 +0000 (21:34 +0200)
Don't check if we have to expire a port if we will remove it anyway.

src/lldpd-structs.c

index 58577f3d7142a650e5dea15de47f20ec52f2a73d..376da98930b1cea03af5d57b5e5e99e6802379f8 100644 (file)
@@ -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++;