]> git.ipfire.org Git - thirdparty/lldpd.git/commitdiff
Reset "sent" flag for each port when sending.
authorVincent Bernat <bernat@luffy.cx>
Thu, 1 Oct 2009 18:59:04 +0000 (20:59 +0200)
committerVincent Bernat <bernat@luffy.cx>
Thu, 1 Oct 2009 18:59:04 +0000 (20:59 +0200)
On ports not receiving anything, we send an LLDP packet only on the
first running port. Others get ignored. We reset "sent" flag to 0 for
each port.

src/lldpd.c

index 0d669a59bd0d2936ee5047fe9a6c545b12f57ce9..14b07d2da77a3453b2648b0f36921680a8afcc8e 100644 (file)
@@ -542,7 +542,7 @@ lldpd_send_all(struct lldpd *cfg)
 {
        struct lldpd_hardware *hardware;
        struct lldpd_port *port;
-       int i, sent = 0;
+       int i, sent;
 
        cfg->g_lastsent = time(NULL);
        TAILQ_FOREACH(hardware, &cfg->g_hardware, h_entries) {
@@ -550,6 +550,7 @@ lldpd_send_all(struct lldpd *cfg)
                if ((hardware->h_flags & IFF_RUNNING) == 0)
                        continue;
 
+               sent = 0;
                for (i=0; cfg->g_protocols[i].mode != 0; i++) {
                        if (!cfg->g_protocols[i].enabled)
                                continue;