Skip to content

Commit

Permalink
zebra: static analyzer reported issue fixes
Browse files Browse the repository at this point in the history
Signed-off-by: Sougata <[email protected]>
  • Loading branch information
sougata-github-nvidia committed Dec 4, 2024
1 parent 5f458b3 commit 3a62811
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 11 deletions.
4 changes: 2 additions & 2 deletions lib/nexthop.c
Original file line number Diff line number Diff line change
Expand Up @@ -1224,7 +1224,7 @@ void nexthop_json_helper(json_object *json_nexthop,
json_object_int_add(json_nexthop, "flags", nexthop->flags);

if (CHECK_FLAG(nexthop->flags, NEXTHOP_FLAG_DUPLICATE))
json_object_boolean_true_add(json_nexthop, "duplicate");
json_object_boolean_true_add(json_nexthop, "duplicate");

if (CHECK_FLAG(nexthop->flags, NEXTHOP_FLAG_FIB))
json_object_boolean_true_add(json_nexthop, "fib");
Expand Down Expand Up @@ -1296,7 +1296,7 @@ void nexthop_json_helper(json_object *json_nexthop,
json_object_string_add(json_nexthop, "vrf",
vrf_id_to_name(nexthop->vrf_id));
if (brief)
return;
return;

/* This nexthop is a resolver for the parent nexthop.
* Set resolver flag for better clarity and delimiter
Expand Down
2 changes: 1 addition & 1 deletion zebra/zebra_evpn.c
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ void zebra_evpn_print(struct zebra_evpn *zevpn, void **ctxt)
json_object_string_add(json, "type", "L2");
json_object_int_add(json, "vlan", zevpn->vid);
json_object_string_add(json, "bridge",
zevpn->bridge_if ? zevpn->bridge_if->name: "");
zevpn->bridge_if ? zevpn->bridge_if->name : "");
json_object_string_add(json, "tenantVrf", vrf_id_to_name(zevpn->vrf_id));
}

Expand Down
9 changes: 4 additions & 5 deletions zebra/zebra_l2_bridge_if.c
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,7 @@
#include "zebra/zebra_evpn_vxlan.h"
#include "zebra/zebra_router.h"

static void zebra_l2_brvlan_print_mac_hash(struct hash_bucket *bucket,
void *ctxt)
static void zebra_l2_brvlan_print_mac_hash(struct hash_bucket *bucket, void *ctxt)
{
struct zebra_l2_brvlan_mac_ctx *ctx;
struct vty *vty;
Expand Down Expand Up @@ -94,8 +93,7 @@ static unsigned int zebra_l2_bridge_vlan_hash_keymake(const void *p)
return jhash(&bvlan->vid, sizeof(bvlan->vid), 0);
}

void zebra_l2_brvlan_print_macs(struct vty *vty, struct interface *br_if,
vlanid_t vid, bool uj)
void zebra_l2_brvlan_print_macs(struct vty *vty, struct interface *br_if, vlanid_t vid, bool uj)
{
struct zebra_if *zif;
struct zebra_l2_bridge_if *br;
Expand All @@ -105,9 +103,10 @@ void zebra_l2_brvlan_print_macs(struct vty *vty, struct interface *br_if,
zif = (struct zebra_if *)br_if->info;
br = BRIDGE_FROM_ZEBRA_IF(zif);
if (!br) {
return;
return;
}
json_object *json_obj = NULL, *json_mac_obj = NULL;

if (uj) { /* json format */
json_obj = json_object_new_object();
json_mac_obj = json_object_new_object();
Expand Down
4 changes: 2 additions & 2 deletions zebra/zebra_l2_bridge_if.h
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,8 @@ extern int
zebra_l2_bridge_if_vlan_access_bd_deref(struct zebra_evpn_access_bd *bd);
extern int
zebra_l2_bridge_if_vlan_access_bd_ref(struct zebra_evpn_access_bd *bd);
extern void zebra_l2_brvlan_print_macs(struct vty *vty, struct interface *br_if,
vlanid_t vid, bool uj);
extern void zebra_l2_brvlan_print_macs(struct vty *vty, struct interface *br_if, vlanid_t vid,
bool uj);
extern int zebra_l2_bridge_if_del(struct interface *ifp);
extern int zebra_l2_bridge_if_add(struct interface *ifp);
extern int zebra_l2_bridge_if_cleanup(struct interface *ifp);
Expand Down
2 changes: 1 addition & 1 deletion zebra/zebra_vty.c
Original file line number Diff line number Diff line change
Expand Up @@ -1675,7 +1675,7 @@ DEFPY(show_nexthop_group,
vty_json_no_pretty(vty, json);
else
vty_json(vty, json);
}
}

return CMD_SUCCESS;
}
Expand Down

0 comments on commit 3a62811

Please sign in to comment.