lib, ospf6d: Refactor if_lookup_prefix

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
This commit is contained in:
Donald Sharp 2017-03-11 07:13:49 -05:00
parent fa787f911c
commit a90607a4ba
3 changed files with 4 additions and 10 deletions

View File

@ -410,7 +410,7 @@ if_lookup_address (void *matchaddr, int family, vrf_id_t vrf_id)
/* Lookup interface by prefix */
struct interface *
if_lookup_prefix_vrf (struct prefix *prefix, vrf_id_t vrf_id)
if_lookup_prefix (struct prefix *prefix, vrf_id_t vrf_id)
{
struct listnode *node;
struct listnode *cnode;
@ -430,12 +430,6 @@ if_lookup_prefix_vrf (struct prefix *prefix, vrf_id_t vrf_id)
return NULL;
}
struct interface *
if_lookup_prefix (struct prefix *prefix)
{
return if_lookup_prefix_vrf (prefix, VRF_DEFAULT);
}
/* Get interface by name if given name interface doesn't exist create
one. */
struct interface *

View File

@ -389,7 +389,6 @@ struct nbr_connected
/* Prototypes. */
extern int if_cmp_name_func (char *, char *);
extern struct interface *if_lookup_prefix (struct prefix *prefix);
extern void if_update_vrf (struct interface *, const char *name, int namelen,
vrf_id_t vrf_id);
@ -400,7 +399,7 @@ extern struct interface *if_lookup_exact_address (void *matchaddr, int family,
vrf_id_t vrf_id);
extern struct connected *if_lookup_address (void *matchaddr, int family,
vrf_id_t vrf_id);
extern struct interface *if_lookup_prefix_vrf (struct prefix *prefix,
extern struct interface *if_lookup_prefix (struct prefix *prefix,
vrf_id_t vrf_id);
/* These 2 functions are to be used when the ifname argument is terminated

View File

@ -30,6 +30,7 @@
#include "table.h"
#include "vty.h"
#include "command.h"
#include "vrf.h"
#include "ospf6_proto.h"
#include "ospf6_message.h"
@ -1311,7 +1312,7 @@ ospf6_intra_prefix_lsa_add (struct ospf6_lsa *lsa)
if (direct_connect)
{
ifp = if_lookup_prefix(&route->prefix);
ifp = if_lookup_prefix(&route->prefix, VRF_DEFAULT);
if (ifp)
ospf6_route_add_nexthop (route, ifp->ifindex, NULL);
}