From e70b76f986e6de4dc682c3e21cae752041f6047d Mon Sep 17 00:00:00 2001 From: Vincent Bernat Date: Wed, 21 Jan 2009 03:35:48 +0100 Subject: [PATCH] Also check if the interface is RUNNING before considering it active. --- src/lldpd.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/lldpd.c b/src/lldpd.c index 3ad0ef39..27a4bbcb 100644 --- a/src/lldpd.c +++ b/src/lldpd.c @@ -1009,7 +1009,8 @@ lldpd_recv_all(struct lldpd *cfg) TAILQ_FOREACH(hardware, &cfg->g_hardware, h_entries) { /* Ignore if interface is down */ - if ((hardware->h_flags & IFF_UP) == 0) + if (((hardware->h_flags & IFF_UP) == 0) || + ((hardware->h_flags & IFF_RUNNING) == 0)) continue; FD_SET(hardware->h_raw, &rfds); if (nfds < hardware->h_raw) @@ -1023,7 +1024,8 @@ lldpd_recv_all(struct lldpd *cfg) } } TAILQ_FOREACH(vif, &cfg->g_vif, vif_entries) { - if ((vif->vif_flags & IFF_UP) == 0) + if (((vif->vif_flags & IFF_UP) == 0) || + ((vif->vif_flags & IFF_RUNNING) == 0)) continue; FD_SET(vif->vif_raw, &rfds); if (nfds < vif->vif_raw) @@ -1197,7 +1199,8 @@ lldpd_send_all(struct lldpd *cfg) cfg->g_lastsent = time(NULL); TAILQ_FOREACH(hardware, &cfg->g_hardware, h_entries) { /* Ignore if interface is down */ - if ((hardware->h_flags & IFF_UP) == 0) + if (((hardware->h_flags & IFF_UP) == 0) || + ((hardware->h_flags & IFF_RUNNING) == 0)) continue; /* When sending on inactive slaves, just send using a 0:0:0:0:0:0 address */ -- 2.39.5