Merge pull request #6865 from volta-networks/fix_ldp_oc_withdraw_7.4

ldpd: ldp-oc withdraw fix
This commit is contained in:
Renato Westphal 2020-08-05 20:59:34 -03:00 committed by GitHub
commit e9faa35ccd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -847,6 +847,9 @@ lde_check_withdraw(struct map *map, struct lde_nbr *ln)
if (me && (map->label == NO_LABEL || map->label == me->map.label)) if (me && (map->label == NO_LABEL || map->label == me->map.label))
/* LWd.4: remove record of previously received lbl mapping */ /* LWd.4: remove record of previously received lbl mapping */
lde_map_del(ln, me, 0); lde_map_del(ln, me, 0);
else
/* LWd.13 done */
return;
/* Ordered Control: additional withdraw steps */ /* Ordered Control: additional withdraw steps */
if (ldeconf->flags & F_LDPD_ORDERED_CONTROL) { if (ldeconf->flags & F_LDPD_ORDERED_CONTROL) {
@ -858,15 +861,17 @@ lde_check_withdraw(struct map *map, struct lde_nbr *ln)
/* LWd.9: check if previously sent a label mapping */ /* LWd.9: check if previously sent a label mapping */
me = (struct lde_map *)fec_find(&lnbr->sent_map, me = (struct lde_map *)fec_find(&lnbr->sent_map,
&fn->fec); &fn->fec);
/* /*
* LWd.10: does label sent to peer "map" to withdraw * LWd.10: does label sent to peer "map" to withdraw
* label * label
*/ */
if (me) if (me && lde_nbr_is_nexthop(fn, lnbr))
/* LWd.11: send label withdraw */ /* LWd.11: send label withdraw */
lde_send_labelwithdraw(lnbr, fn, NULL, NULL); lde_send_labelwithdraw(lnbr, fn, NULL, NULL);
} }
} }
} }
void void
@ -924,24 +929,33 @@ lde_check_withdraw_wcard(struct map *map, struct lde_nbr *ln)
* label mapping * label mapping
*/ */
lde_map_del(ln, me, 0); lde_map_del(ln, me, 0);
else
/* LWd.13 done */
continue;
/* Ordered Control: additional withdraw steps */ /* Ordered Control: additional withdraw steps */
if (ldeconf->flags & F_LDPD_ORDERED_CONTROL) { 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) { RB_FOREACH(lnbr, nbr_tree, &lde_nbrs) {
if (ln->peerid == lnbr->peerid) if (ln->peerid == lnbr->peerid)
continue; continue;
/* LWd.9: check if previously sent a label mapping */ /* LWd.9: check if previously sent a label
me = (struct lde_map *)fec_find(&lnbr->sent_map, * mapping
&fn->fec);
/*
* LWd.10: does label sent to peer "map" to withdraw
* label
*/ */
if (me) me = (struct lde_map *)fec_find(
&lnbr->sent_map, &fn->fec);
/*
* LWd.10: does label sent to peer "map" to
* withdraw label
*/
if (me && lde_nbr_is_nexthop(fn, lnbr))
/* LWd.11: send label withdraw */ /* LWd.11: send label withdraw */
lde_send_labelwithdraw(lnbr, fn, NULL, NULL); lde_send_labelwithdraw(lnbr, fn, NULL,
NULL);
} }
} }
} }