Skip to content

Commit

Permalink
Merge pull request FRRouting#6864 from volta-networks/fix_ldp_oc_with…
Browse files Browse the repository at this point in the history
…draw

ldpd: ldp-oc withdraw fix
  • Loading branch information
rwestphal authored Aug 5, 2020
2 parents 2b42623 + 8dfdf23 commit 814e861
Showing 1 changed file with 23 additions and 9 deletions.
32 changes: 23 additions & 9 deletions ldpd/lde_lib.c
Original file line number Diff line number Diff line change
Expand Up @@ -856,6 +856,9 @@ lde_check_withdraw(struct map *map, struct lde_nbr *ln)
if (me && (map->label == NO_LABEL || map->label == me->map.label))
/* LWd.4: remove record of previously received lbl mapping */
lde_map_del(ln, me, 0);
else
/* LWd.13 done */
return;

/* Ordered Control: additional withdraw steps */
if (ldeconf->flags & F_LDPD_ORDERED_CONTROL) {
Expand All @@ -867,15 +870,17 @@ lde_check_withdraw(struct map *map, struct lde_nbr *ln)
/* LWd.9: check if previously sent a label mapping */
me = (struct lde_map *)fec_find(&lnbr->sent_map,
&fn->fec);

/*
* LWd.10: does label sent to peer "map" to withdraw
* label
*/
if (me)
if (me && lde_nbr_is_nexthop(fn, lnbr))
/* LWd.11: send label withdraw */
lde_send_labelwithdraw(lnbr, fn, NULL, NULL);
}
}

}

void
Expand Down Expand Up @@ -933,24 +938,33 @@ lde_check_withdraw_wcard(struct map *map, struct lde_nbr *ln)
* label mapping
*/
lde_map_del(ln, me, 0);
else
/* LWd.13 done */
continue;

/* Ordered Control: additional withdraw steps */
if (ldeconf->flags & F_LDPD_ORDERED_CONTROL) {
/* LWd.8: for each neighbor other that src of withdraw msg */
/*
* LWd.8: for each neighbor other that src of
* withdraw msg
*/
RB_FOREACH(lnbr, nbr_tree, &lde_nbrs) {
if (ln->peerid == lnbr->peerid)
continue;

/* LWd.9: check if previously sent a label mapping */
me = (struct lde_map *)fec_find(&lnbr->sent_map,
&fn->fec);
/* LWd.9: check if previously sent a label
* mapping
*/
me = (struct lde_map *)fec_find(
&lnbr->sent_map, &fn->fec);
/*
* LWd.10: does label sent to peer "map" to withdraw
* label
* LWd.10: does label sent to peer "map" to
* withdraw label
*/
if (me)
if (me && lde_nbr_is_nexthop(fn, lnbr))
/* LWd.11: send label withdraw */
lde_send_labelwithdraw(lnbr, fn, NULL, NULL);
lde_send_labelwithdraw(lnbr, fn, NULL,
NULL);
}
}
}
Expand Down

0 comments on commit 814e861

Please sign in to comment.