summaryrefslogtreecommitdiff
path: root/zebra
diff options
context:
space:
mode:
Diffstat (limited to 'zebra')
-rw-r--r--zebra/zebra_mpls.c2
-rw-r--r--zebra/zebra_vxlan.c47
2 files changed, 2 insertions, 47 deletions
diff --git a/zebra/zebra_mpls.c b/zebra/zebra_mpls.c
index 424a11546d..2a454b4a6a 100644
--- a/zebra/zebra_mpls.c
+++ b/zebra/zebra_mpls.c
@@ -2433,7 +2433,7 @@ void mpls_ldp_lsp_uninstall_all(struct hash_backet *backet, void *ctxt)
struct hash *lsp_table;
lsp = (zebra_lsp_t *)backet->data;
- if (!lsp || !lsp->nhlfe_list)
+ if (!lsp->nhlfe_list)
return;
lsp_table = ctxt;
diff --git a/zebra/zebra_vxlan.c b/zebra/zebra_vxlan.c
index 17a25b7005..541b46c994 100644
--- a/zebra/zebra_vxlan.c
+++ b/zebra/zebra_vxlan.c
@@ -280,8 +280,6 @@ static void zvni_find_neigh_addr_width(struct hash_backet *backet, void *ctxt)
int width;
n = (zebra_neigh_t *)backet->data;
- if (!n)
- return;
ipaddr2str(&n->ip, buf, sizeof(buf)), width = strlen(buf);
if (width > wctx->addr_width)
@@ -355,8 +353,6 @@ static void zvni_print_neigh_hash(struct hash_backet *backet, void *ctxt)
vty = wctx->vty;
json_vni = wctx->json;
n = (zebra_neigh_t *)backet->data;
- if (!n)
- return;
if (json_vni)
json_row = json_object_new_object();
@@ -435,11 +431,7 @@ static void zvni_print_neigh_hash_all_vni(struct hash_backet *backet,
json = (json_object *)args[1];
zvni = (zebra_vni_t *)backet->data;
- if (!zvni) {
- if (json)
- vty_out(vty, "{}\n");
- return;
- }
+
num_neigh = hashcount(zvni->neigh_table);
if (json == NULL) {
vty_out(vty,
@@ -628,8 +620,6 @@ static void zvni_print_mac_hash(struct hash_backet *backet, void *ctxt)
vty = wctx->vty;
json_mac_hdr = wctx->json;
mac = (zebra_mac_t *)backet->data;
- if (!mac)
- return;
prefix_mac2str(&mac->macaddr, buf1, sizeof(buf1));
@@ -735,11 +725,6 @@ static void zvni_print_mac_hash_all_vni(struct hash_backet *backet, void *ctxt)
json = (struct json_object *)wctx->json;
zvni = (zebra_vni_t *)backet->data;
- if (!zvni) {
- if (json)
- vty_out(vty, "{}\n");
- return;
- }
wctx->zvni = zvni;
/*We are iterating over a new VNI, set the count to 0*/
@@ -794,8 +779,6 @@ static void zl3vni_print_nh_hash(struct hash_backet *backet, void *ctx)
if (json_vni)
json_nh = json_object_new_object();
n = (zebra_neigh_t *)backet->data;
- if (!n)
- return;
if (!json_vni) {
vty_out(vty, "%-15s %-17s\n",
@@ -828,11 +811,6 @@ static void zl3vni_print_nh_hash_all_vni(struct hash_backet *backet,
json = (struct json_object *)args[1];
zl3vni = (zebra_l3vni_t *)backet->data;
- if (!zl3vni) {
- if (json)
- vty_out(vty, "{}\n");
- return;
- }
num_nh = hashcount(zl3vni->nh_table);
if (!num_nh)
@@ -872,11 +850,6 @@ static void zl3vni_print_rmac_hash_all_vni(struct hash_backet *backet,
json = (struct json_object *)args[1];
zl3vni = (zebra_l3vni_t *)backet->data;
- if (!zl3vni) {
- if (json)
- vty_out(vty, "{}\n");
- return;
- }
num_rmacs = hashcount(zl3vni->rmac_table);
if (!num_rmacs)
@@ -920,8 +893,6 @@ static void zl3vni_print_rmac_hash(struct hash_backet *backet, void *ctx)
if (json)
json_rmac = json_object_new_object();
zrmac = (zebra_mac_t *)backet->data;
- if (!zrmac)
- return;
if (!json) {
vty_out(vty, "%-17s %-21s\n",
@@ -1098,8 +1069,6 @@ static void zl3vni_print_hash(struct hash_backet *backet, void *ctx[])
json = (json_object *)ctx[1];
zl3vni = (zebra_l3vni_t *)backet->data;
- if (!zl3vni)
- return;
if (!json) {
vty_out(vty, "%-10u %-4s %-21s %-8lu %-8lu %-15s %-37s\n",
@@ -1147,8 +1116,6 @@ static void zvni_print_hash(struct hash_backet *backet, void *ctxt[])
json = ctxt[1];
zvni = (zebra_vni_t *)backet->data;
- if (!zvni)
- return;
zvtep = zvni->vteps;
while (zvtep) {
@@ -1653,8 +1620,6 @@ static void zvni_install_neigh_hash(struct hash_backet *backet, void *ctxt)
struct neigh_walk_ctx *wctx = ctxt;
n = (zebra_neigh_t *)backet->data;
- if (!n)
- return;
if (CHECK_FLAG(n->flags, ZEBRA_NEIGH_REMOTE))
zvni_neigh_install(wctx->zvni, n);
@@ -1919,8 +1884,6 @@ static void zvni_gw_macip_del_for_vni_hash(struct hash_backet *backet,
/* Add primary SVI MAC*/
zvni = (zebra_vni_t *)backet->data;
- if (!zvni)
- return;
ifp = zvni->vxlan_if;
if (!ifp)
@@ -1960,8 +1923,6 @@ static void zvni_gw_macip_add_for_vni_hash(struct hash_backet *backet,
struct interface *ifp = NULL;
zvni = (zebra_vni_t *)backet->data;
- if (!zvni)
- return;
ifp = zvni->vxlan_if;
if (!ifp)
@@ -2622,8 +2583,6 @@ static void zvni_install_mac_hash(struct hash_backet *backet, void *ctxt)
struct mac_walk_ctx *wctx = ctxt;
mac = (zebra_mac_t *)backet->data;
- if (!mac)
- return;
if (CHECK_FLAG(mac->flags, ZEBRA_MAC_REMOTE))
zvni_mac_install(wctx->zvni, mac);
@@ -3067,8 +3026,6 @@ static void zvni_cleanup_all(struct hash_backet *backet, void *arg)
struct zebra_vrf *zvrf = (struct zebra_vrf *)arg;
zvni = (zebra_vni_t *)backet->data;
- if (!zvni)
- return;
/* remove from l3-vni list */
if (zvrf->l3vni)
@@ -3093,8 +3050,6 @@ static void zl3vni_cleanup_all(struct hash_backet *backet, void *args)
zebra_l3vni_t *zl3vni = NULL;
zl3vni = (zebra_l3vni_t *)backet->data;
- if (!zl3vni)
- return;
zebra_vxlan_process_l3vni_oper_down(zl3vni);
}