summaryrefslogtreecommitdiff
path: root/zebra/zebra_mpls.c
diff options
context:
space:
mode:
Diffstat (limited to 'zebra/zebra_mpls.c')
-rw-r--r--zebra/zebra_mpls.c46
1 files changed, 20 insertions, 26 deletions
diff --git a/zebra/zebra_mpls.c b/zebra/zebra_mpls.c
index 0aac7d7b12..5c375a6bef 100644
--- a/zebra/zebra_mpls.c
+++ b/zebra/zebra_mpls.c
@@ -85,8 +85,8 @@ static int nhlfe_nexthop_active_ipv6(zebra_nhlfe_t *nhlfe,
static int nhlfe_nexthop_active(zebra_nhlfe_t *nhlfe);
static void lsp_select_best_nhlfe(zebra_lsp_t *lsp);
-static void lsp_uninstall_from_kernel(struct hash_backet *backet, void *ctxt);
-static void lsp_schedule(struct hash_backet *backet, void *ctxt);
+static void lsp_uninstall_from_kernel(struct hash_bucket *bucket, void *ctxt);
+static void lsp_schedule(struct hash_bucket *bucket, void *ctxt);
static wq_item_status lsp_process(struct work_queue *wq, void *data);
static void lsp_processq_del(struct work_queue *wq, void *data);
static void lsp_processq_complete(struct work_queue *wq);
@@ -249,8 +249,7 @@ static int lsp_install(struct zebra_vrf *zvrf, mpls_label_t label,
lsp->ile.in_label, lsp->flags);
lsp = hash_release(lsp_table, &lsp->ile);
- if (lsp)
- XFREE(MTYPE_LSP, lsp);
+ XFREE(MTYPE_LSP, lsp);
}
return 0;
@@ -313,8 +312,7 @@ static int lsp_uninstall(struct zebra_vrf *zvrf, mpls_label_t label)
lsp->ile.in_label, lsp->flags);
lsp = hash_release(lsp_table, &lsp->ile);
- if (lsp)
- XFREE(MTYPE_LSP, lsp);
+ XFREE(MTYPE_LSP, lsp);
}
return 0;
@@ -853,11 +851,11 @@ static void lsp_select_best_nhlfe(zebra_lsp_t *lsp)
* Delete LSP forwarding entry from kernel, if installed. Called upon
* process exit.
*/
-static void lsp_uninstall_from_kernel(struct hash_backet *backet, void *ctxt)
+static void lsp_uninstall_from_kernel(struct hash_bucket *bucket, void *ctxt)
{
zebra_lsp_t *lsp;
- lsp = (zebra_lsp_t *)backet->data;
+ lsp = (zebra_lsp_t *)bucket->data;
if (CHECK_FLAG(lsp->flags, LSP_FLAG_INSTALLED))
(void)dplane_lsp_delete(lsp);
}
@@ -866,11 +864,11 @@ static void lsp_uninstall_from_kernel(struct hash_backet *backet, void *ctxt)
* Schedule LSP forwarding entry for processing. Called upon changes
* that may impact LSPs such as nexthop / connected route changes.
*/
-static void lsp_schedule(struct hash_backet *backet, void *ctxt)
+static void lsp_schedule(struct hash_bucket *bucket, void *ctxt)
{
zebra_lsp_t *lsp;
- lsp = (zebra_lsp_t *)backet->data;
+ lsp = (zebra_lsp_t *)bucket->data;
(void)lsp_processq_add(lsp);
}
@@ -1048,8 +1046,7 @@ static void lsp_processq_del(struct work_queue *wq, void *data)
lsp->ile.in_label, lsp->flags);
lsp = hash_release(lsp_table, &lsp->ile);
- if (lsp)
- XFREE(MTYPE_LSP, lsp);
+ XFREE(MTYPE_LSP, lsp);
}
}
@@ -1335,8 +1332,7 @@ static int mpls_lsp_uninstall_all(struct hash *lsp_table, zebra_lsp_t *lsp,
lsp->ile.in_label, lsp->flags);
lsp = hash_release(lsp_table, &lsp->ile);
- if (lsp)
- XFREE(MTYPE_LSP, lsp);
+ XFREE(MTYPE_LSP, lsp);
}
return 0;
@@ -1492,7 +1488,7 @@ static json_object *lsp_json(zebra_lsp_t *lsp)
static struct list *hash_get_sorted_list(struct hash *hash, void *cmp)
{
unsigned int i;
- struct hash_backet *hb;
+ struct hash_bucket *hb;
struct list *sorted_list = list_new();
sorted_list->cmp = (int (*)(void *, void *))cmp;
@@ -1659,8 +1655,7 @@ static int snhlfe_del(zebra_snhlfe_t *snhlfe)
slsp->snhlfe_list = snhlfe->next;
snhlfe->prev = snhlfe->next = NULL;
- if (snhlfe->ifname)
- XFREE(MTYPE_SNHLFE_IFNAME, snhlfe->ifname);
+ XFREE(MTYPE_SNHLFE_IFNAME, snhlfe->ifname);
XFREE(MTYPE_SNHLFE, snhlfe);
return 0;
@@ -1800,9 +1795,10 @@ void zebra_mpls_lsp_dplane_result(struct zebra_dplane_ctx *ctx)
break;
case DPLANE_OP_LSP_DELETE:
- flog_warn(EC_ZEBRA_LSP_DELETE_FAILURE,
- "LSP Deletion Failure: in-label %u",
- dplane_ctx_get_in_label(ctx));
+ if (status != ZEBRA_DPLANE_REQUEST_SUCCESS)
+ flog_warn(EC_ZEBRA_LSP_DELETE_FAILURE,
+ "LSP Deletion Failure: in-label %u",
+ dplane_ctx_get_in_label(ctx));
break;
default:
@@ -2538,8 +2534,7 @@ int mpls_lsp_uninstall(struct zebra_vrf *zvrf, enum lsp_types_t type,
lsp->ile.in_label, lsp->flags);
lsp = hash_release(lsp_table, &lsp->ile);
- if (lsp)
- XFREE(MTYPE_LSP, lsp);
+ XFREE(MTYPE_LSP, lsp);
}
}
return 0;
@@ -2549,12 +2544,12 @@ int mpls_lsp_uninstall(struct zebra_vrf *zvrf, enum lsp_types_t type,
* Uninstall all LDP NHLFEs for a particular LSP forwarding entry.
* If no other NHLFEs exist, the entry would be deleted.
*/
-void mpls_ldp_lsp_uninstall_all(struct hash_backet *backet, void *ctxt)
+void mpls_ldp_lsp_uninstall_all(struct hash_bucket *bucket, void *ctxt)
{
zebra_lsp_t *lsp;
struct hash *lsp_table;
- lsp = (zebra_lsp_t *)backet->data;
+ lsp = (zebra_lsp_t *)bucket->data;
if (!lsp->nhlfe_list)
return;
@@ -2783,8 +2778,7 @@ int zebra_mpls_static_lsp_del(struct zebra_vrf *zvrf, mpls_label_t in_label,
* above. */
if (!slsp->snhlfe_list) {
slsp = hash_release(slsp_table, &tmp_ile);
- if (slsp)
- XFREE(MTYPE_SLSP, slsp);
+ XFREE(MTYPE_SLSP, slsp);
}
return 0;