lldpad/lldpad-0.9.43-lldpad-Add-ports-even-w-out-link-at-init-time.patch
2011-09-08 08:34:30 +02:00

45 lines
1.2 KiB
Diff

From 215fa56eb62adcf5cfd757c2f226c58de3f07180 Mon Sep 17 00:00:00 2001
From: John Fastabend <john.r.fastabend@intel.com>
Date: Wed, 27 Jul 2011 15:03:33 -0700
Subject: [PATCH 06/29] lldpad: Add ports even w/out link at init time
It may be helpful to configure devices even before the device
has link. To facilitate this add ports to port list regardless
of link status.
Signed-off-by: John Fastabend <john.r.fastabend@intel.com>
Signed-off-by: Petr Sabata <contyk@redhat.com>
---
config.c | 12 +++++++-----
1 files changed, 7 insertions(+), 5 deletions(-)
diff --git a/config.c b/config.c
index 4d42581..a8ebe17 100644
--- a/config.c
+++ b/config.c
@@ -358,14 +358,16 @@ void init_ports(void)
;
} else if (is_bridge(p->if_name)) {
; /* ignore bridge device */
- } else if (check_link_status(p->if_name)) {
+ } else {
add_port(p->if_name);
- LIST_FOREACH(np, &lldp_head, lldp) {
- if (np->ops->lldp_mod_ifup)
- np->ops->lldp_mod_ifup(p->if_name);
+ if (check_link_status(p->if_name)) {
+ LIST_FOREACH(np, &lldp_head, lldp) {
+ if (np->ops->lldp_mod_ifup)
+ np->ops->lldp_mod_ifup(p->if_name);
+ }
+ set_lldp_port_enable_state(p->if_name, 1);
}
- set_lldp_port_enable_state(p->if_name, 1);
}
p++;
}
--
1.7.6