Skip to content

Commit

Permalink
Merge pull request FRRouting#5240 from donaldsharp/zebra_nhg_sa
Browse files Browse the repository at this point in the history
ZEBRA COVERITY STUFF
  • Loading branch information
ton31337 authored Oct 29, 2019
2 parents 50f450b + d1accb2 commit 8bee640
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 10 deletions.
9 changes: 7 additions & 2 deletions zebra/rt_netlink.c
Original file line number Diff line number Diff line change
Expand Up @@ -2246,6 +2246,7 @@ static struct nexthop netlink_nexthop_process_nh(struct rtattr **tb,
enum nexthop_types_t type = 0;
int if_index = 0;
size_t sz = 0;
struct interface *ifp_lookup;

if_index = *(int *)RTA_DATA(tb[NHA_OIF]);

Expand Down Expand Up @@ -2280,9 +2281,13 @@ static struct nexthop netlink_nexthop_process_nh(struct rtattr **tb,
if (if_index)
nh.ifindex = if_index;

*ifp = if_lookup_by_index_per_ns(zebra_ns_lookup(ns_id), nh.ifindex);
ifp_lookup =
if_lookup_by_index_per_ns(zebra_ns_lookup(ns_id), nh.ifindex);

if (ifp)
nh.vrf_id = (*ifp)->vrf_id;
*ifp = ifp_lookup;
if (ifp_lookup)
nh.vrf_id = ifp_lookup->vrf_id;
else {
flog_warn(
EC_ZEBRA_UNKNOWN_INTERFACE,
Expand Down
3 changes: 1 addition & 2 deletions zebra/zebra_nhg.c
Original file line number Diff line number Diff line change
Expand Up @@ -886,8 +886,7 @@ static void nhg_ctx_process_finish(struct nhg_ctx *ctx)
nexthop_del_labels(nh);

done:
if (ctx)
nhg_ctx_free(ctx);
nhg_ctx_free(ctx);
}

static int queue_add(struct nhg_ctx *ctx)
Expand Down
14 changes: 8 additions & 6 deletions zebra/zebra_vxlan.c
Original file line number Diff line number Diff line change
Expand Up @@ -5775,12 +5775,14 @@ static void process_remote_macip_del(vni_t vni,
vlan_if = zvni_map_to_svi(vxl->access_vlan,
zif->brslave_info.br_if);
if (IS_ZEBRA_DEBUG_VXLAN)
zlog_debug("%s: IP %s (flags 0x%x intf %s) is remote and duplicate, read kernel for local entry",
__PRETTY_FUNCTION__,
ipaddr2str(ipaddr, buf1,
sizeof(buf1)), n->flags,
vlan_if->name);
neigh_read_specific_ip(ipaddr, vlan_if);
zlog_debug(
"%s: IP %s (flags 0x%x intf %s) is remote and duplicate, read kernel for local entry",
__PRETTY_FUNCTION__,
ipaddr2str(ipaddr, buf1, sizeof(buf1)),
n->flags,
vlan_if ? vlan_if->name : "Unknown");
if (vlan_if)
neigh_read_specific_ip(ipaddr, vlan_if);
}

/* When the MAC changes for an IP, it is possible the
Expand Down

0 comments on commit 8bee640

Please sign in to comment.