summaryrefslogtreecommitdiffstats
path: root/zebra/zebra_mpls.c
diff options
context:
space:
mode:
authorMark Stapp <mjs@voltanet.io>2020-02-25 14:29:46 +0100
committerMark Stapp <mjs@voltanet.io>2020-02-27 21:49:31 +0100
commitc415d89528f5cd7128e5b4c4cd65cce01d64fc80 (patch)
treec7604b3cf422eec7f9edd464af522251b7a20d6a /zebra/zebra_mpls.c
parentlib: use const in nexthop_group copy api (diff)
downloadfrr-c415d89528f5cd7128e5b4c4cd65cce01d64fc80.tar.xz
frr-c415d89528f5cd7128e5b4c4cd65cce01d64fc80.zip
zebra: Embed lib nexthop-group in zebra hash entry
Embed nexthop-group, which is just a pointer, in the zebra nexthop-hash-entry object, rather than mallocing one. Signed-off-by: Mark Stapp <mjs@voltanet.io>
Diffstat (limited to 'zebra/zebra_mpls.c')
-rw-r--r--zebra/zebra_mpls.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/zebra/zebra_mpls.c b/zebra/zebra_mpls.c
index c167e6a8a..fa6b95224 100644
--- a/zebra/zebra_mpls.c
+++ b/zebra/zebra_mpls.c
@@ -186,7 +186,7 @@ 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->nhe->nhg->nexthop;
+ for (nexthop = re->nhe->nhg.nexthop;
nexthop; nexthop = nexthop->next) {
/* Skip inactive and recursive entries. */
if (!CHECK_FLAG(nexthop->flags, NEXTHOP_FLAG_ACTIVE))
@@ -638,7 +638,7 @@ static int nhlfe_nexthop_active_ipv4(zebra_nhlfe_t *nhlfe,
|| !CHECK_FLAG(match->flags, ZEBRA_FLAG_SELECTED))
continue;
- for (match_nh = match->nhe->nhg->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) {
@@ -689,10 +689,10 @@ static int nhlfe_nexthop_active_ipv6(zebra_nhlfe_t *nhlfe,
break;
}
- if (!match || !match->nhe->nhg->nexthop)
+ if (!match || !match->nhe->nhg.nexthop)
return 0;
- nexthop->ifindex = match->nhe->nhg->nexthop->ifindex;
+ nexthop->ifindex = match->nhe->nhg.nexthop->ifindex;
return 1;
}
@@ -2631,7 +2631,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->nhe->nhg);
+ nexthop_group_copy(&new_grp, &(re->nhe->nhg));
found = false;
for (nexthop = new_grp.nexthop; nexthop; nexthop = nexthop->next) {
@@ -2712,7 +2712,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->nhe->nhg);
+ nexthop_group_copy(&new_grp, &(re->nhe->nhg));
for (nexthop = new_grp.nexthop; nexthop; nexthop = nexthop->next)
nexthop_del_labels(nexthop);
@@ -2949,7 +2949,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->nhe->nhg);
+ nexthop_group_copy(&new_grp, &(re->nhe->nhg));
for (nexthop = new_grp.nexthop; nexthop;
nexthop = nexthop->next) {