Skip to content

Commit

Permalink
ldpd: no need to synchronize pseudowires with LSPs anymore
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
rwestphal committed Mar 31, 2017
1 parent f790d62 commit 7263291
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 48 deletions.
31 changes: 0 additions & 31 deletions ldpd/l2vpn.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down
16 changes: 0 additions & 16 deletions ldpd/lde.c
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand All @@ -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 ||
Expand Down Expand Up @@ -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));
Expand All @@ -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;
Expand Down
1 change: 0 additions & 1 deletion ldpd/lde.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down

0 comments on commit 7263291

Please sign in to comment.