diff options
Diffstat (limited to 'zebra/zebra_mpls.c')
| -rw-r--r-- | zebra/zebra_mpls.c | 47 |
1 files changed, 21 insertions, 26 deletions
diff --git a/zebra/zebra_mpls.c b/zebra/zebra_mpls.c index ec80081a46..0af06806d3 100644 --- a/zebra/zebra_mpls.c +++ b/zebra/zebra_mpls.c @@ -182,7 +182,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->nexthop; nexthop; nexthop = nexthop->next) { + for (nexthop = re->ng.nexthop; nexthop; nexthop = nexthop->next) { /* Skip inactive and recursive entries. */ if (!CHECK_FLAG(nexthop->flags, NEXTHOP_FLAG_ACTIVE)) continue; @@ -411,8 +411,8 @@ static int fec_change_update_lsp(struct zebra_vrf *zvrf, zebra_fec_t *fec, afi_t afi; /* Uninstall label forwarding entry, if previously installed. */ - if (old_label != MPLS_INVALID_LABEL && - old_label != MPLS_LABEL_IMPLICIT_NULL) + if (old_label != MPLS_INVALID_LABEL + && old_label != MPLS_LABEL_IMPLICIT_NULL) lsp_uninstall(zvrf, old_label); /* Install label forwarding entry corr. to new label, if needed. */ @@ -637,7 +637,7 @@ static int nhlfe_nexthop_active_ipv4(zebra_nhlfe_t *nhlfe, || !CHECK_FLAG(match->flags, ZEBRA_FLAG_SELECTED)) continue; - for (match_nh = match->nexthop; match_nh; + for (match_nh = match->ng.nexthop; match_nh; match_nh = match_nh->next) { if (match->type == ZEBRA_ROUTE_CONNECT || nexthop->ifindex == match_nh->ifindex) { @@ -688,10 +688,10 @@ static int nhlfe_nexthop_active_ipv6(zebra_nhlfe_t *nhlfe, break; } - if (!match || !match->nexthop) + if (!match || !match->ng.nexthop) return 0; - nexthop->ifindex = match->nexthop->ifindex; + nexthop->ifindex = match->ng.nexthop->ifindex; return 1; } @@ -937,16 +937,16 @@ static wq_item_status lsp_process(struct work_queue *wq, void *data) * Any NHLFE that was installed but is not * selected now needs to have its flags updated. */ - for (nhlfe = lsp->nhlfe_list; - nhlfe; nhlfe = nhlfe->next) { + for (nhlfe = lsp->nhlfe_list; nhlfe; + nhlfe = nhlfe->next) { nexthop = nhlfe->nexthop; if (!nexthop) continue; if (CHECK_FLAG(nhlfe->flags, - NHLFE_FLAG_INSTALLED) && - !CHECK_FLAG(nhlfe->flags, - NHLFE_FLAG_SELECTED)) { + NHLFE_FLAG_INSTALLED) + && !CHECK_FLAG(nhlfe->flags, + NHLFE_FLAG_SELECTED)) { UNSET_FLAG(nhlfe->flags, NHLFE_FLAG_INSTALLED); UNSET_FLAG(nexthop->flags, @@ -1398,9 +1398,9 @@ static void nhlfe_print(zebra_nhlfe_t *nhlfe, struct vty *vty) default: break; } - vty_out(vty, "%s", CHECK_FLAG(nhlfe->flags, NHLFE_FLAG_INSTALLED) - ? " (installed)" - : ""); + vty_out(vty, "%s", + CHECK_FLAG(nhlfe->flags, NHLFE_FLAG_INSTALLED) ? " (installed)" + : ""); vty_out(vty, "\n"); } @@ -1688,8 +1688,7 @@ static int mpls_processq_init(struct zebra_t *zebra) /* Public functions */ -void kernel_lsp_pass_fail(zebra_lsp_t *lsp, - enum southbound_results res) +void kernel_lsp_pass_fail(zebra_lsp_t *lsp, enum southbound_results res) { struct nexthop *nexthop; zebra_nhlfe_t *nhlfe; @@ -2287,7 +2286,7 @@ int mpls_ftn_update(int add, struct zebra_vrf *zvrf, enum lsp_types_t type, if (re == NULL) return -1; - for (nexthop = re->nexthop; nexthop; nexthop = nexthop->next) { + for (nexthop = re->ng.nexthop; nexthop; nexthop = nexthop->next) { switch (nexthop->type) { case NEXTHOP_TYPE_IPV4: case NEXTHOP_TYPE_IPV4_IFINDEX: @@ -2505,7 +2504,7 @@ void mpls_ldp_ftn_uninstall_all(struct zebra_vrf *zvrf, int afi) for (rn = route_top(table); rn; rn = route_next(rn)) { update = 0; RNODE_FOREACH_RE (rn, re) { - for (nexthop = re->nexthop; nexthop; + for (nexthop = re->ng.nexthop; nexthop; nexthop = nexthop->next) { if (nexthop->nh_label_type != ZEBRA_LSP_LDP) continue; @@ -2793,8 +2792,7 @@ void zebra_mpls_print_lsp_table(struct vty *vty, struct zebra_vrf *zvrf, nexthop = nhlfe->nexthop; switch (nexthop->type) { - case NEXTHOP_TYPE_IFINDEX: - { + case NEXTHOP_TYPE_IFINDEX: { struct interface *ifp; ifp = if_lookup_by_index( @@ -2955,12 +2953,9 @@ void zebra_mpls_init_tables(struct zebra_vrf *zvrf) { if (!zvrf) return; - zvrf->slsp_table = hash_create(label_hash, - label_cmp, - "ZEBRA SLSP table"); - zvrf->lsp_table = hash_create(label_hash, - label_cmp, - "ZEBRA LSP table"); + zvrf->slsp_table = + hash_create(label_hash, label_cmp, "ZEBRA SLSP table"); + zvrf->lsp_table = hash_create(label_hash, label_cmp, "ZEBRA LSP table"); zvrf->fec_table[AFI_IP] = route_table_init(); zvrf->fec_table[AFI_IP6] = route_table_init(); zvrf->mpls_flags = 0; |
