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.c16
1 files changed, 5 insertions, 11 deletions
diff --git a/zebra/zebra_mpls.c b/zebra/zebra_mpls.c
index 1210430b06..31b100598f 100644
--- a/zebra/zebra_mpls.c
+++ b/zebra/zebra_mpls.c
@@ -1258,8 +1258,7 @@ static zebra_nhlfe_t *nhlfe_alloc(zebra_lsp_t *lsp, enum lsp_types_t lsp_type,
zebra_nhlfe_t *nhlfe;
struct nexthop *nexthop;
- if (!lsp)
- return NULL;
+ assert(lsp);
nhlfe = XCALLOC(MTYPE_NHLFE, sizeof(zebra_nhlfe_t));
@@ -1268,10 +1267,6 @@ static zebra_nhlfe_t *nhlfe_alloc(zebra_lsp_t *lsp, enum lsp_types_t lsp_type,
nhlfe->distance = lsp_distance(lsp_type);
nexthop = nexthop_new();
- if (!nexthop) {
- XFREE(MTYPE_NHLFE, nhlfe);
- return NULL;
- }
nexthop_add_labels(nexthop, lsp_type, num_labels, labels);
@@ -1322,8 +1317,7 @@ static zebra_nhlfe_t *nhlfe_add(zebra_lsp_t *lsp, enum lsp_types_t lsp_type,
labels);
/* Enqueue to LSP, at head of list. */
- if (nhlfe)
- nhlfe_list_add_head(&lsp->nhlfe_list, nhlfe);
+ nhlfe_list_add_head(&lsp->nhlfe_list, nhlfe);
return nhlfe;
}
@@ -1351,8 +1345,7 @@ static zebra_nhlfe_t *nhlfe_backup_add(zebra_lsp_t *lsp,
SET_FLAG(nhlfe->flags, NHLFE_FLAG_IS_BACKUP);
/* Enqueue to LSP, at tail of list. */
- if (nhlfe)
- nhlfe_list_add_tail(&lsp->backup_nhlfe_list, nhlfe);
+ nhlfe_list_add_tail(&lsp->backup_nhlfe_list, nhlfe);
return nhlfe;
}
@@ -1568,7 +1561,8 @@ static void nhlfe_print(zebra_nhlfe_t *nhlfe, struct vty *vty)
case NEXTHOP_TYPE_IPV6:
case NEXTHOP_TYPE_IPV6_IFINDEX:
vty_out(vty, " via %s",
- inet_ntop(AF_INET6, &nexthop->gate.ipv6, buf, BUFSIZ));
+ inet_ntop(AF_INET6, &nexthop->gate.ipv6, buf,
+ sizeof(buf)));
if (nexthop->ifindex)
vty_out(vty, " dev %s",
ifindex2ifname(nexthop->ifindex,