Skip to content

Commit

Permalink
ldpd: Unset Status Up flag on PW removal
Browse files Browse the repository at this point in the history
Signed-off-by: Renato Westphal <[email protected]>
  • Loading branch information
ßingen committed Jun 16, 2017
1 parent f44e282 commit 681ee35
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions ldpd/lde.c
Original file line number Diff line number Diff line change
Expand Up @@ -789,6 +789,11 @@ lde_send_change_klabel(struct fec_node *fn, struct fec_nh *fnh)
pw = (struct l2vpn_pw *) fn->data;
if (pw->flags & F_PW_STATUS_UP)
return;
/*
* NOTE: we don't set the F_PW_STATUS_UP flag here. Instead,
* we wait for a ZEBRA_PW_STATUS_UPDATE message from zebra to
* know if the pseudowire was successfully installed or not.
*/

memset(&kpw, 0, sizeof(kpw));
strlcpy(kpw.ifname, pw->ifname, sizeof(kpw.ifname));
Expand Down Expand Up @@ -849,6 +854,11 @@ lde_send_delete_klabel(struct fec_node *fn, struct fec_nh *fnh)
pw = (struct l2vpn_pw *) fn->data;
if (!(pw->flags & F_PW_STATUS_UP))
return;
/*
* Unset the F_PW_STATUS_UP flag regardless if the pseudowire
* was successfully uninstalled or not.
*/
pw->flags &= ~F_PW_STATUS_UP;

memset(&kpw, 0, sizeof(kpw));
strlcpy(kpw.ifname, pw->ifname, sizeof(kpw.ifname));
Expand Down

0 comments on commit 681ee35

Please sign in to comment.