From a90607a4ba81caec852bd2e15f541ff12b08c031 Mon Sep 17 00:00:00 2001 From: Donald Sharp Date: Sat, 11 Mar 2017 07:13:49 -0500 Subject: [PATCH] lib, ospf6d: Refactor if_lookup_prefix Signed-off-by: Donald Sharp --- lib/if.c | 8 +------- lib/if.h | 3 +-- ospf6d/ospf6_intra.c | 3 ++- 3 files changed, 4 insertions(+), 10 deletions(-) diff --git a/lib/if.c b/lib/if.c index 633c949ca3..4c8f16d37d 100644 --- a/lib/if.c +++ b/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 * diff --git a/lib/if.h b/lib/if.h index 7a1274c31e..7a0e6042bc 100644 --- a/lib/if.h +++ b/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 diff --git a/ospf6d/ospf6_intra.c b/ospf6d/ospf6_intra.c index d93406fb68..6461963856 100644 --- a/ospf6d/ospf6_intra.c +++ b/ospf6d/ospf6_intra.c @@ -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); } -- 2.39.5