Skip to content

Commit

Permalink
Merge pull request FRRouting#17012 from dksharp5/remove_function
Browse files Browse the repository at this point in the history
zebra: remove unused function rib_lookup_ipv4
  • Loading branch information
ton31337 authored Oct 7, 2024
2 parents 28a614d + 8eb5f4f commit 86a2c82
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 42 deletions.
3 changes: 0 additions & 3 deletions zebra/rib.h
Original file line number Diff line number Diff line change
Expand Up @@ -408,9 +408,6 @@ extern struct route_entry *rib_match_multicast(afi_t afi, vrf_id_t vrf_id,
union g_addr *gaddr,
struct route_node **rn_out);

extern struct route_entry *rib_lookup_ipv4(struct prefix_ipv4 *p,
vrf_id_t vrf_id);

extern void rib_update(enum rib_update_event event);
extern void rib_update_table(struct route_table *table,
enum rib_update_event event, int rtype);
Expand Down
39 changes: 0 additions & 39 deletions zebra/zebra_rib.c
Original file line number Diff line number Diff line change
Expand Up @@ -611,45 +611,6 @@ struct route_entry *rib_match_multicast(afi_t afi, vrf_id_t vrf_id,
return re;
}

struct route_entry *rib_lookup_ipv4(struct prefix_ipv4 *p, vrf_id_t vrf_id)
{
struct route_table *table;
struct route_node *rn;
struct route_entry *match = NULL;
rib_dest_t *dest;

/* Lookup table. */
table = zebra_vrf_table(AFI_IP, SAFI_UNICAST, vrf_id);
if (!table)
return 0;

rn = route_node_lookup(table, (struct prefix *)p);

/* No route for this prefix. */
if (!rn)
return NULL;

/* Unlock node. */
route_unlock_node(rn);
dest = rib_dest_from_rnode(rn);

if (dest && dest->selected_fib
&& !CHECK_FLAG(dest->selected_fib->status, ROUTE_ENTRY_REMOVED))
match = dest->selected_fib;

if (!match)
return NULL;

if (match->type == ZEBRA_ROUTE_CONNECT ||
match->type == ZEBRA_ROUTE_LOCAL)
return match;

if (CHECK_FLAG(match->status, ROUTE_ENTRY_INSTALLED))
return match;

return NULL;
}

/*
* Is this RIB labeled-unicast? It must be of type BGP and all paths
* (nexthops) must have a label.
Expand Down

0 comments on commit 86a2c82

Please sign in to comment.