diff options
author | Mark Stapp <mjs@voltanet.io> | 2019-11-22 21:30:53 +0100 |
---|---|---|
committer | Mark Stapp <mjs@voltanet.io> | 2019-12-04 14:13:52 +0100 |
commit | 0eb97b860dc94329cf9add9f8f3d3a2c7f539568 (patch) | |
tree | 4382d83b863bbec02b3df6adf9060e7686a7a814 /zebra/zebra_mpls.c | |
parent | lib: add some nexthop ctors (diff) | |
download | frr-0eb97b860dc94329cf9add9f8f3d3a2c7f539568.tar.xz frr-0eb97b860dc94329cf9add9f8f3d3a2c7f539568.zip |
lib,zebra: use nhg_hash_entry pointer in route_entry
Replace the existing list of nexthops (via a nexthop_group
struct) in the route_entry with a direct pointer to zebra's
new shared group (from zebra_nhg.h). This allows more
direct access to that shared group and the info it carries.
Signed-off-by: Mark Stapp <mjs@voltanet.io>
Diffstat (limited to 'zebra/zebra_mpls.c')
-rw-r--r-- | zebra/zebra_mpls.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/zebra/zebra_mpls.c b/zebra/zebra_mpls.c index 3a44db9dc..87ea0cf0f 100644 --- a/zebra/zebra_mpls.c +++ b/zebra/zebra_mpls.c @@ -185,7 +185,8 @@ static int lsp_install(struct zebra_vrf *zvrf, mpls_label_t label, * the label advertised by the recursive nexthop (plus we don't have the * logic yet to push multiple labels). */ - for (nexthop = re->ng->nexthop; nexthop; nexthop = nexthop->next) { + for (nexthop = re->nhe->nhg->nexthop; + nexthop; nexthop = nexthop->next) { /* Skip inactive and recursive entries. */ if (!CHECK_FLAG(nexthop->flags, NEXTHOP_FLAG_ACTIVE)) continue; @@ -635,7 +636,7 @@ static int nhlfe_nexthop_active_ipv4(zebra_nhlfe_t *nhlfe, || !CHECK_FLAG(match->flags, ZEBRA_FLAG_SELECTED)) continue; - for (match_nh = match->ng->nexthop; match_nh; + for (match_nh = match->nhe->nhg->nexthop; match_nh; match_nh = match_nh->next) { if (match->type == ZEBRA_ROUTE_CONNECT || nexthop->ifindex == match_nh->ifindex) { @@ -686,10 +687,10 @@ static int nhlfe_nexthop_active_ipv6(zebra_nhlfe_t *nhlfe, break; } - if (!match || !match->ng->nexthop) + if (!match || !match->nhe->nhg->nexthop) return 0; - nexthop->ifindex = match->ng->nexthop->ifindex; + nexthop->ifindex = match->nhe->nhg->nexthop->ifindex; return 1; } @@ -2626,7 +2627,7 @@ int mpls_ftn_update(int add, struct zebra_vrf *zvrf, enum lsp_types_t type, * We can't just change the values here since we are hashing * on labels. We need to create a whole new group */ - nexthop_group_copy(&new_grp, re->ng); + nexthop_group_copy(&new_grp, re->nhe->nhg); found = false; for (nexthop = new_grp.nexthop; nexthop; nexthop = nexthop->next) { @@ -2707,7 +2708,7 @@ int mpls_ftn_uninstall(struct zebra_vrf *zvrf, enum lsp_types_t type, if (re == NULL) return -1; - nexthop_group_copy(&new_grp, re->ng); + nexthop_group_copy(&new_grp, re->nhe->nhg); for (nexthop = new_grp.nexthop; nexthop; nexthop = nexthop->next) nexthop_del_labels(nexthop); @@ -2921,7 +2922,7 @@ static void mpls_ftn_uninstall_all(struct zebra_vrf *zvrf, RNODE_FOREACH_RE (rn, re) { struct nexthop_group new_grp = {}; - nexthop_group_copy(&new_grp, re->ng); + nexthop_group_copy(&new_grp, re->nhe->nhg); for (nexthop = new_grp.nexthop; nexthop; nexthop = nexthop->next) { |