Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

some more coverity fixups #6248

Merged
merged 4 commits into from
Apr 17, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions lib/filter.c
Original file line number Diff line number Diff line change
Expand Up @@ -2294,6 +2294,7 @@ DEFUN (ipv6_access_list_exact,
if (argv_find(argv, argc, "exact-match", &idx))
exact = 1;

assert(prefix);
return filter_set_zebra(vty, argv[idx_word]->arg, seq, permit_deny,
AFI_IP6, prefix, exact, 1);
}
Expand Down
2 changes: 1 addition & 1 deletion ospfd/ospf_snmp.c
Original file line number Diff line number Diff line change
Expand Up @@ -784,7 +784,7 @@ static struct ospf_area *ospfStubAreaLookup(struct variable *v, oid name[],

area = ospf_area_lookup_by_area_id(ospf, *addr);

if (area->external_routing == OSPF_AREA_STUB)
if (area && area->external_routing == OSPF_AREA_STUB)
return area;
else
return NULL;
Expand Down
6 changes: 5 additions & 1 deletion pimd/pim_nht.c
Original file line number Diff line number Diff line change
Expand Up @@ -788,7 +788,11 @@ int pim_parse_nexthop_update(ZAPI_CALLBACK_ARGS)
case NEXTHOP_TYPE_IPV6_IFINDEX:
ifp1 = if_lookup_by_index(nexthop->ifindex,
pim->vrf_id);
nbr = pim_neighbor_find_if(ifp1);

if (!ifp1)
nbr = NULL;
else
nbr = pim_neighbor_find_if(ifp1);
/* Overwrite with Nbr address as NH addr */
if (nbr)
nexthop->gate.ipv4 = nbr->source_addr;
Expand Down
20 changes: 10 additions & 10 deletions pimd/pim_zlookup.c
Original file line number Diff line number Diff line change
Expand Up @@ -285,17 +285,17 @@ static int zclient_read_nexthop(struct pim_instance *pim,
* If we are sending v6 secondary assume we receive v6
* secondary
*/
if (pim->send_v6_secondary)
nbr = pim_neighbor_find_by_secondary(
if_lookup_by_index(
nexthop_tab[num_ifindex]
.ifindex,
nexthop_vrf_id),
&p);
struct interface *ifp = if_lookup_by_index(
nexthop_tab[num_ifindex].ifindex,
nexthop_vrf_id);

if (!ifp)
nbr = NULL;
else if (pim->send_v6_secondary)
nbr = pim_neighbor_find_by_secondary(ifp, &p);
else
nbr = pim_neighbor_find_if(if_lookup_by_index(
nexthop_tab[num_ifindex].ifindex,
nexthop_vrf_id));
nbr = pim_neighbor_find_if(ifp);

if (nbr) {
nexthop_tab[num_ifindex].nexthop_addr.family =
AF_INET;
Expand Down
4 changes: 2 additions & 2 deletions zebra/zebra_snmp.c
Original file line number Diff line number Diff line change
Expand Up @@ -266,9 +266,9 @@ static void check_replace(struct route_node *np2, struct route_entry *re2,
return;
}

if (in_addr_cmp(&(*np)->p.u.prefix, &np2->p.u.prefix) < 0)
if (prefix_cmp(&(*np)->p, &np2->p) < 0)
return;
if (in_addr_cmp(&(*np)->p.u.prefix, &np2->p.u.prefix) > 0) {
if (prefix_cmp(&(*np)->p, &np2->p) > 0) {
*np = np2;
*re = re2;
return;
Expand Down