From 726329191d8c153a91af70396513ebc71f50e4a1 Mon Sep 17 00:00:00 2001 From: Renato Westphal Date: Thu, 30 Mar 2017 20:19:16 -0300 Subject: [PATCH] ldpd: no need to synchronize pseudowires with LSPs anymore Since commit 595b4be, the l2vpn_pw_ok() function doesn't check if there's a working LSP to the remote end of the pseudowire (we assume that zebra will do that for us). With that said, the l2vpn_sync_pws() function is not necessary anymore. Signed-off-by: Renato Westphal --- ldpd/l2vpn.c | 31 ------------------------------- ldpd/lde.c | 16 ---------------- ldpd/lde.h | 1 - 3 files changed, 48 deletions(-) diff --git a/ldpd/l2vpn.c b/ldpd/l2vpn.c index ca40636e09df..bdfcd420ebab 100644 --- a/ldpd/l2vpn.c +++ b/ldpd/l2vpn.c @@ -463,37 +463,6 @@ l2vpn_recv_pw_status_wcard(struct lde_nbr *ln, struct notify_msg *nm) } } -void -l2vpn_sync_pws(int af, union ldpd_addr *addr) -{ - struct l2vpn *l2vpn; - struct l2vpn_pw *pw; - struct fec fec; - struct fec_node *fn; - struct fec_nh *fnh; - - RB_FOREACH(l2vpn, l2vpn_head, &ldeconf->l2vpn_tree) { - RB_FOREACH(pw, l2vpn_pw_head, &l2vpn->pw_tree) { - if (af != pw->af || ldp_addrcmp(af, &pw->addr, addr)) - continue; - - l2vpn_pw_fec(pw, &fec); - fn = (struct fec_node *)fec_find(&ft, &fec); - if (fn == NULL) - continue; - fnh = fec_nh_find(fn, AF_INET, (union ldpd_addr *) - &pw->lsr_id, 0, 0); - if (fnh == NULL) - continue; - - if (l2vpn_pw_ok(pw, fnh)) - lde_send_change_klabel(fn, fnh); - else - lde_send_delete_klabel(fn, fnh); - } - } -} - void l2vpn_pw_ctl(pid_t pid) { diff --git a/ldpd/lde.c b/ldpd/lde.c index 53fde32fd9ce..bc808e68412f 100644 --- a/ldpd/lde.c +++ b/ldpd/lde.c @@ -725,10 +725,6 @@ lde_send_change_klabel(struct fec_node *fn, struct fec_nh *fnh) lde_imsg_compose_parent(IMSG_KLABEL_CHANGE, 0, &kr, sizeof(kr)); - - if (fn->fec.u.ipv4.prefixlen == 32) - l2vpn_sync_pws(AF_INET, (union ldpd_addr *) - &fn->fec.u.ipv4.prefix); break; case FEC_TYPE_IPV6: memset(&kr, 0, sizeof(kr)); @@ -743,10 +739,6 @@ lde_send_change_klabel(struct fec_node *fn, struct fec_nh *fnh) lde_imsg_compose_parent(IMSG_KLABEL_CHANGE, 0, &kr, sizeof(kr)); - - if (fn->fec.u.ipv6.prefixlen == 128) - l2vpn_sync_pws(AF_INET6, (union ldpd_addr *) - &fn->fec.u.ipv6.prefix); break; case FEC_TYPE_PWID: if (fn->local_label == NO_LABEL || @@ -792,10 +784,6 @@ lde_send_delete_klabel(struct fec_node *fn, struct fec_nh *fnh) lde_imsg_compose_parent(IMSG_KLABEL_DELETE, 0, &kr, sizeof(kr)); - - if (fn->fec.u.ipv4.prefixlen == 32) - l2vpn_sync_pws(AF_INET, (union ldpd_addr *) - &fn->fec.u.ipv4.prefix); break; case FEC_TYPE_IPV6: memset(&kr, 0, sizeof(kr)); @@ -810,10 +798,6 @@ lde_send_delete_klabel(struct fec_node *fn, struct fec_nh *fnh) lde_imsg_compose_parent(IMSG_KLABEL_DELETE, 0, &kr, sizeof(kr)); - - if (fn->fec.u.ipv6.prefixlen == 128) - l2vpn_sync_pws(AF_INET6, (union ldpd_addr *) - &fn->fec.u.ipv6.prefix); break; case FEC_TYPE_PWID: pw = (struct l2vpn_pw *) fn->data; diff --git a/ldpd/lde.h b/ldpd/lde.h index d1089b44f46e..8ee62b02d36a 100644 --- a/ldpd/lde.h +++ b/ldpd/lde.h @@ -231,7 +231,6 @@ void l2vpn_send_pw_status_wcard(struct lde_nbr *, uint32_t, void l2vpn_recv_pw_status(struct lde_nbr *, struct notify_msg *); void l2vpn_recv_pw_status_wcard(struct lde_nbr *, struct notify_msg *); -void l2vpn_sync_pws(int, union ldpd_addr *); void l2vpn_pw_ctl(pid_t); void l2vpn_binding_ctl(pid_t);