From 0d86e62fcff0e7b7466a6438dad10e0d423aeba3 Mon Sep 17 00:00:00 2001 From: Vincent Bernat Date: Thu, 1 Oct 2009 20:59:04 +0200 Subject: [PATCH] Reset "sent" flag for each port when sending. 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 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/lldpd.c b/src/lldpd.c index 0d669a59..14b07d2d 100644 --- a/src/lldpd.c +++ b/src/lldpd.c @@ -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; -- 2.39.5