mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-03 20:27:03 +00:00
lib, ospf6d: Refactor if_lookup_prefix
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
This commit is contained in:
parent
fa787f911c
commit
a90607a4ba
8
lib/if.c
8
lib/if.c
@ -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 *
|
||||
|
3
lib/if.h
3
lib/if.h
@ -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
|
||||
|
@ -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);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user