summaryrefslogtreecommitdiffstats
path: root/ldpd/lde.c
diff options
context:
space:
mode:
authorRenato Westphal <renato@opensourcerouting.org>2017-03-31 02:58:47 +0200
committerRenato Westphal <renato@opensourcerouting.org>2017-03-31 17:57:37 +0200
commit52b530fc64355933d428e2b88591cbf926b85bc8 (patch)
tree3aa1c68bb61da7fbd462b86aa0cada9ade2054c6 /ldpd/lde.c
parentldpd: remove the interface vty node (diff)
downloadfrr-52b530fc64355933d428e2b88591cbf926b85bc8.tar.xz
frr-52b530fc64355933d428e2b88591cbf926b85bc8.zip
ldpd: fix configuration of non-existing VPLS interfaces and pseudowires
If we don't know the ifindex, flags, etc of an interface at the time it's configured, we should make sure that once this information is available the appropriate structures are updated. Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
Diffstat (limited to 'ldpd/lde.c')
-rw-r--r--ldpd/lde.c34
1 files changed, 30 insertions, 4 deletions
diff --git a/ldpd/lde.c b/ldpd/lde.c
index bc808e684..607a9f7b1 100644
--- a/ldpd/lde.c
+++ b/ldpd/lde.c
@@ -439,13 +439,14 @@ static int
lde_dispatch_parent(struct thread *thread)
{
static struct ldpd_conf *nconf;
- struct iface *niface;
+ struct iface *iface, *niface;
struct tnbr *ntnbr;
struct nbr_params *nnbrp;
- static struct l2vpn *nl2vpn;
- struct l2vpn_if *nlif;
- struct l2vpn_pw *npw;
+ static struct l2vpn *l2vpn, *nl2vpn;
+ struct l2vpn_if *lif, *nlif;
+ struct l2vpn_pw *pw, *npw;
struct imsg imsg;
+ struct kif *kif;
struct kroute *kr;
int fd = THREAD_FD(thread);
struct imsgev *iev = THREAD_ARG(thread);
@@ -468,6 +469,31 @@ lde_dispatch_parent(struct thread *thread)
break;
switch (imsg.hdr.type) {
+ case IMSG_IFSTATUS:
+ if (imsg.hdr.len != IMSG_HEADER_SIZE +
+ sizeof(struct kif))
+ fatalx("IFSTATUS imsg with wrong len");
+ kif = imsg.data;
+
+ iface = if_lookup_name(ldeconf, kif->ifname);
+ if (iface) {
+ if_update_info(iface, kif);
+ break;
+ }
+
+ RB_FOREACH(l2vpn, l2vpn_head, &ldeconf->l2vpn_tree) {
+ lif = l2vpn_if_find(l2vpn, kif->ifname);
+ if (lif) {
+ l2vpn_if_update_info(lif, kif);
+ break;
+ }
+ pw = l2vpn_pw_find(l2vpn, kif->ifname);
+ if (pw) {
+ l2vpn_pw_update_info(pw, kif);
+ break;
+ }
+ }
+ break;
case IMSG_NETWORK_ADD:
case IMSG_NETWORK_UPDATE:
if (imsg.hdr.len != IMSG_HEADER_SIZE +