diff options
| author | Russ White <russ@riw.us> | 2020-09-01 10:31:20 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-09-01 10:31:20 -0400 |
| commit | edec686a2a86d8e20af3f5514561d67d265340f6 (patch) | |
| tree | 8453599b7c89044298798b0610fa7fcb964755eb /pbrd/pbr_map.c | |
| parent | c2ce62e50244369cf9fb515ec24e40864876e214 (diff) | |
| parent | 734bf907cbb6c8a44af41168a38e2cb57a25b926 (diff) | |
Merge pull request #7016 from donaldsharp/pbr_vrf_is_burf
Pbr vrf is burf
Diffstat (limited to 'pbrd/pbr_map.c')
| -rw-r--r-- | pbrd/pbr_map.c | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/pbrd/pbr_map.c b/pbrd/pbr_map.c index 10a75a9f54..cce97b5dfb 100644 --- a/pbrd/pbr_map.c +++ b/pbrd/pbr_map.c @@ -771,6 +771,57 @@ void pbr_map_check_nh_group_change(const char *nh_group) } } +void pbr_map_check_vrf_nh_group_change(const char *nh_group, + struct pbr_vrf *pbr_vrf, + uint32_t old_vrf_id) +{ + struct pbr_map *pbrm; + struct pbr_map_sequence *pbrms; + struct listnode *node; + + + RB_FOREACH (pbrm, pbr_map_entry_head, &pbr_maps) { + for (ALL_LIST_ELEMENTS_RO(pbrm->seqnumbers, node, pbrms)) { + if (pbrms->nhgrp_name) + continue; + + if (pbrms->nhg + && strcmp(nh_group, pbrms->internal_nhg_name)) + continue; + + if (pbrms->nhg->nexthop->vrf_id != old_vrf_id) + continue; + + pbrms->nhg->nexthop->vrf_id = pbr_vrf_id(pbr_vrf); + } + } +} + +void pbr_map_check_interface_nh_group_change(const char *nh_group, + struct interface *ifp, + ifindex_t oldifindex) +{ + struct pbr_map *pbrm; + struct pbr_map_sequence *pbrms; + struct listnode *node; + + RB_FOREACH (pbrm, pbr_map_entry_head, &pbr_maps) { + for (ALL_LIST_ELEMENTS_RO(pbrm->seqnumbers, node, pbrms)) { + if (pbrms->nhgrp_name) + continue; + + if (pbrms->nhg + && strcmp(nh_group, pbrms->internal_nhg_name)) + continue; + + if (pbrms->nhg->nexthop->ifindex != oldifindex) + continue; + + pbrms->nhg->nexthop->ifindex = ifp->ifindex; + } + } +} + void pbr_map_check(struct pbr_map_sequence *pbrms, bool changed) { struct pbr_map *pbrm; |
