]> git.puffer.fish Git - mirror/frr.git/commitdiff
*: Refactor if_lookup_by_name to be VRF aware
authorDonald Sharp <sharpd@cumulusnetworks.com>
Sat, 11 Mar 2017 12:27:15 +0000 (07:27 -0500)
committerDonald Sharp <sharpd@cumulusnetworks.com>
Wed, 15 Mar 2017 14:36:23 +0000 (10:36 -0400)
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
25 files changed:
bgpd/bgp_network.c
bgpd/bgp_zebra.c
bgpd/bgpd.c
isisd/isis_te.c
ldpd/ldp_vty_conf.c
lib/if.c
lib/if.h
nhrpd/nhrp_interface.c
ospf6d/ospf6_asbr.c
ospf6d/ospf6_interface.c
ospf6d/ospf6_top.c
ospfd/ospf_routemap.c
ospfd/ospf_te.c
ospfd/ospf_vty.c
pimd/pim_cmd.c
pimd/pim_iface.c
ripd/rip_routemap.c
ripd/ripd.c
ripngd/ripng_routemap.c
ripngd/ripngd.c
zebra/if_ioctl.c
zebra/interface.c
zebra/kernel_socket.c
zebra/zebra_vrf.c
zebra/zebra_vty.c

index 1358ebc5ef8c3c685b5ee43c0581e2548fcf85e3..b85dcf6c41854b494b1e948eac0fc9e8af01721f 100644 (file)
@@ -262,7 +262,7 @@ bgp_get_instance_for_inc_conn (int sock, struct bgp **bgp_inst)
       if (bgp->inst_type == BGP_INSTANCE_TYPE_VIEW)
         continue;
 
-      ifp = if_lookup_by_name_vrf (name, bgp->vrf_id);
+      ifp = if_lookup_by_name (name, bgp->vrf_id);
       if (ifp)
         {
           *bgp_inst = bgp;
@@ -544,7 +544,7 @@ bgp_update_source (struct peer *peer)
   /* Source is specified with interface name.  */
   if (peer->update_if)
     {
-      ifp = if_lookup_by_name_vrf (peer->update_if, peer->bgp->vrf_id);
+      ifp = if_lookup_by_name (peer->update_if, peer->bgp->vrf_id);
       if (! ifp)
        return -1;
 
index 2a513dda25619c60cc43e18f7bf46e3583c50190..32ad87cb7a46a0b298f43e347660af8298106c55 100644 (file)
@@ -1026,7 +1026,7 @@ bgp_nexthop_set (union sockunion *local, union sockunion *remote,
     {
       nexthop->v4 = local->sin.sin_addr;
       if (peer->update_if)
-        ifp = if_lookup_by_name_vrf (peer->update_if, peer->bgp->vrf_id);
+        ifp = if_lookup_by_name (peer->update_if, peer->bgp->vrf_id);
       else
         ifp = if_lookup_by_ipv4_exact (&local->sin.sin_addr, peer->bgp->vrf_id);
     }
@@ -1035,10 +1035,10 @@ bgp_nexthop_set (union sockunion *local, union sockunion *remote,
       if (IN6_IS_ADDR_LINKLOCAL (&local->sin6.sin6_addr))
        {
          if (peer->conf_if || peer->ifname)
-           ifp = if_lookup_by_name_vrf (peer->conf_if ? peer->conf_if : peer->ifname, peer->bgp->vrf_id);
+           ifp = if_lookup_by_name (peer->conf_if ? peer->conf_if : peer->ifname, peer->bgp->vrf_id);
        }
       else if (peer->update_if)
-        ifp = if_lookup_by_name_vrf (peer->update_if, peer->bgp->vrf_id);
+        ifp = if_lookup_by_name (peer->update_if, peer->bgp->vrf_id);
       else
         ifp = if_lookup_by_ipv6_exact (&local->sin6.sin6_addr,
                                       local->sin6.sin6_scope_id,
index ce0718df5a43aa1426cc22135600b108f3088cd0..30243e80b21b8360fb5df798bf7ba11e2f9b5f46 100644 (file)
@@ -1435,7 +1435,7 @@ bgp_peer_conf_if_to_su_update (struct peer *peer)
     return;
 
   prev_family = peer->su.sa.sa_family;
-  if ((ifp = if_lookup_by_name_vrf (peer->conf_if, peer->bgp->vrf_id)))
+  if ((ifp = if_lookup_by_name (peer->conf_if, peer->bgp->vrf_id)))
     {
       peer->ifp = ifp;
       /* If BGP unnumbered is not "v6only", we first see if we can derive the
index 830ccb37c6d2cf8a673628fbbd56f3697b6417a4..b04d0db3cadef0df068dbab5cf982c79520edef8 100644 (file)
@@ -1323,7 +1323,7 @@ DEFUN (show_isis_mpls_te_interface,
   /* Interface name is specified. */
   else
     {
-      if ((ifp = if_lookup_by_name (argv[idx_interface]->arg)) == NULL)
+      if ((ifp = if_lookup_by_name (argv[idx_interface]->arg, VRF_DEFAULT)) == NULL)
         vty_out (vty, "No such interface name%s", VTY_NEWLINE);
       else
         show_mpls_te_sub (vty, ifp);
index 4d1af62146c720b1a9e12acaf87f13c6cf8f5280..f313bc147b4ffa558d38d1ab0eb9a9d40e432c55 100644 (file)
@@ -900,7 +900,7 @@ ldp_vty_interface(struct vty *vty, struct vty_arg *args[])
                        goto cancel;
                }
 
-               ifp = if_lookup_by_name(ifname);
+               ifp = if_lookup_by_name(ifname, VRF_DEFAULT);
                memset(&kif, 0, sizeof(kif));
                strlcpy(kif.ifname, ifname, sizeof(kif.ifname));
                if (ifp) {
@@ -1558,7 +1558,7 @@ ldp_vty_l2vpn_interface(struct vty *vty, struct vty_arg *args[])
                goto cancel;
        }
 
-       ifp = if_lookup_by_name(ifname);
+       ifp = if_lookup_by_name(ifname, VRF_DEFAULT);
        memset(&kif, 0, sizeof(kif));
        strlcpy(kif.ifname, ifname, sizeof(kif.ifname));
        if (ifp) {
@@ -1616,7 +1616,7 @@ ldp_vty_l2vpn_pseudowire(struct vty *vty, struct vty_arg *args[])
                goto cancel;
        }
 
-       ifp = if_lookup_by_name(ifname);
+       ifp = if_lookup_by_name(ifname, VRF_DEFAULT);
        memset(&kif, 0, sizeof(kif));
        strlcpy(kif.ifname, ifname, sizeof(kif.ifname));
        if (ifp) {
@@ -1809,7 +1809,7 @@ iface_new_api(struct ldpd_conf *conf, const char *name)
 
        memset(&kif, 0, sizeof(kif));
        strlcpy(kif.ifname, ifname, sizeof(kif.ifname));
-       ifp = if_lookup_by_name(ifname);
+       ifp = if_lookup_by_name(ifname, VRF_DEFAULT);
        if (ifp) {
                kif.ifindex = ifp->ifindex;
                kif.flags = ifp->flags;
@@ -1920,7 +1920,7 @@ l2vpn_if_new_api(struct ldpd_conf *conf, struct l2vpn *l2vpn,
 
        memset(&kif, 0, sizeof(kif));
        strlcpy(kif.ifname, ifname, sizeof(kif.ifname));
-       ifp = if_lookup_by_name(ifname);
+       ifp = if_lookup_by_name(ifname, VRF_DEFAULT);
        if (ifp) {
                kif.ifindex = ifp->ifindex;
                kif.flags = ifp->flags;
@@ -1951,7 +1951,7 @@ l2vpn_pw_new_api(struct ldpd_conf *conf, struct l2vpn *l2vpn,
 
        memset(&kif, 0, sizeof(kif));
        strlcpy(kif.ifname, ifname, sizeof(kif.ifname));
-       ifp = if_lookup_by_name(ifname);
+       ifp = if_lookup_by_name(ifname, VRF_DEFAULT);
        if (ifp) {
                kif.ifindex = ifp->ifindex;
                kif.flags = ifp->flags;
index 4c8f16d37ddafac30c20aa459518ae1c6d46ff5f..4f2eb3a1c5fcdfacc3f03f84eead25a3e46c1f7c 100644 (file)
--- a/lib/if.c
+++ b/lib/if.c
@@ -136,7 +136,7 @@ if_create (const char *name, int namelen, vrf_id_t vrf_id)
   strncpy (ifp->name, name, namelen);
   ifp->name[namelen] = '\0';
   ifp->vrf_id = vrf_id;
-  if (if_lookup_by_name_vrf (ifp->name, vrf_id) == NULL)
+  if (if_lookup_by_name (ifp->name, vrf_id) == NULL)
     listnode_add_sort (intf_list, ifp);
   else
     zlog_err("if_create(%s): corruption detected -- interface with this "
@@ -173,7 +173,7 @@ if_update_vrf (struct interface *ifp, const char *name, int namelen, vrf_id_t vr
   strncpy (ifp->name, name, namelen);
   ifp->name[namelen] = '\0';
   ifp->vrf_id = vrf_id;
-  if (if_lookup_by_name_vrf (ifp->name, vrf_id) == NULL)
+  if (if_lookup_by_name (ifp->name, vrf_id) == NULL)
     listnode_add_sort (intf_list, ifp);
   else
     zlog_err("if_create(%s): corruption detected -- interface with this "
@@ -266,7 +266,7 @@ ifname2ifindex_vrf (const char *name, vrf_id_t vrf_id)
 {
   struct interface *ifp;
 
-  return ((ifp = if_lookup_by_name_vrf (name, vrf_id)) != NULL) ? ifp->ifindex
+  return ((ifp = if_lookup_by_name (name, vrf_id)) != NULL) ? ifp->ifindex
                                                    : IFINDEX_INTERNAL;
 }
 
@@ -278,7 +278,7 @@ ifname2ifindex (const char *name)
 
 /* Interface existance check by interface name. */
 struct interface *
-if_lookup_by_name_vrf (const char *name, vrf_id_t vrf_id)
+if_lookup_by_name (const char *name, vrf_id_t vrf_id)
 {
   struct listnode *node;
   struct interface *ifp;
@@ -300,7 +300,7 @@ if_lookup_by_name_all_vrf (const char *name)
 
   RB_FOREACH (vrf, vrf_id_head, &vrfs_by_id)
     {
-      ifp = if_lookup_by_name_vrf (name, vrf->vrf_id);
+      ifp = if_lookup_by_name (name, vrf->vrf_id);
       if (ifp)
        return ifp;
     }
@@ -308,12 +308,6 @@ if_lookup_by_name_all_vrf (const char *name)
   return NULL;
 }
 
-struct interface *
-if_lookup_by_name (const char *name)
-{
-  return if_lookup_by_name_vrf (name, VRF_DEFAULT);
-}
-
 struct interface *
 if_lookup_by_name_len (const char *name, size_t namelen, vrf_id_t vrf_id)
 {
@@ -437,7 +431,7 @@ if_get_by_name_vrf (const char *name, vrf_id_t vrf_id)
 {
   struct interface *ifp;
 
-  return ((ifp = if_lookup_by_name_vrf (name, vrf_id)) != NULL) ? ifp :
+  return ((ifp = if_lookup_by_name (name, vrf_id)) != NULL) ? ifp :
          if_create (name, strlen(name), vrf_id);
 }
 
@@ -771,7 +765,7 @@ DEFUN_NOSH (no_interface,
   if (argc > 3)
     VRF_GET_ID (vrf_id, vrfname);
 
-  ifp = if_lookup_by_name_vrf (ifname, vrf_id);
+  ifp = if_lookup_by_name (ifname, vrf_id);
 
   if (ifp == NULL)
     {
index 7a0e6042bcdb36f9ccabf07fd74907c1277db2b9..262e292ac555bb448ccbfb0ca3c384a366b0b1ce 100644 (file)
--- a/lib/if.h
+++ b/lib/if.h
@@ -404,12 +404,11 @@ extern struct interface *if_lookup_prefix (struct prefix *prefix,
 
 /* These 2 functions are to be used when the ifname argument is terminated
    by a '\0' character: */
-extern struct interface *if_lookup_by_name (const char *ifname);
 extern struct interface *if_get_by_name (const char *ifname);
 
 extern struct interface *if_lookup_by_name_all_vrf (const char *ifname);
-extern struct interface *if_lookup_by_name_vrf (const char *ifname,
-                                vrf_id_t vrf_id);
+extern struct interface *if_lookup_by_name (const char *ifname,
+                                                vrf_id_t vrf_id);
 extern struct interface *if_get_by_name_vrf (const char *ifname,
                                 vrf_id_t vrf_id);
 
index 052b9c1e83464ec4a62ad8402cc33d995fb3fea8..bbaa630cd5ec098e1a53ee0b0ca9ed84975fbc3e 100644 (file)
@@ -117,7 +117,7 @@ static void nhrp_interface_update_nbma(struct interface *ifp)
        sockunion_family(&nbma) = AF_UNSPEC;
 
        if (nifp->source)
-               nbmaifp = if_lookup_by_name(nifp->source);
+          nbmaifp = if_lookup_by_name(nifp->source, VRF_DEFAULT);
 
        switch (ifp->ll_type) {
        case ZEBRA_LLT_IPGRE: {
index 5f2d662b78573e2d053c627d6d39a640f7814477..8caae502211fba50588af1169a6fb5688a6009b9 100644 (file)
@@ -866,7 +866,7 @@ ospf6_routemap_rule_match_interface (void *rule, struct prefix *prefix,
   if (type == RMAP_OSPF6)
     {
       ei = ((struct ospf6_route *) object)->route_option;
-      ifp = if_lookup_by_name ((char *)rule);
+      ifp = if_lookup_by_name ((char *)rule, VRF_DEFAULT);
 
       if (ifp != NULL
       &&  ei->ifindex == ifp->ifindex)
index 62c77e6f875312046181f67ed84219e818d66670..8e0779df92e0e44e41a86d401b7c7ebe4cb72960 100644 (file)
@@ -1006,7 +1006,7 @@ DEFUN (show_ipv6_ospf6_interface,
 
   if (argc == 5)
     {
-      ifp = if_lookup_by_name (argv[idx_ifname]->arg);
+      ifp = if_lookup_by_name (argv[idx_ifname]->arg, VRF_DEFAULT);
       if (ifp == NULL)
         {
           vty_out (vty, "No such Interface: %s%s", argv[idx_ifname]->arg,
@@ -1043,7 +1043,7 @@ DEFUN (show_ipv6_ospf6_interface_ifname_prefix,
   struct interface *ifp;
   struct ospf6_interface *oi;
 
-  ifp = if_lookup_by_name (argv[idx_ifname]->arg);
+  ifp = if_lookup_by_name (argv[idx_ifname]->arg, VRF_DEFAULT);
   if (ifp == NULL)
     {
       vty_out (vty, "No such Interface: %s%s", argv[idx_ifname]->arg, VNL);
@@ -1897,7 +1897,7 @@ DEFUN (clear_ipv6_ospf6_interface,
     }
   else /* Interface name is specified. */
     {
-      if ((ifp = if_lookup_by_name (argv[idx_ifname]->arg)) == NULL)
+      if ((ifp = if_lookup_by_name (argv[idx_ifname]->arg, VRF_DEFAULT)) == NULL)
         {
           vty_out (vty, "No such Interface: %s%s", argv[idx_ifname]->arg, VNL);
           return CMD_WARNING;
index 92111c73fc4ab53b1e062ae1386d6cd1a3d90ddc..9e741d07d25122fe71905026df0e28dffa292d1e 100644 (file)
@@ -728,7 +728,7 @@ DEFUN (no_ospf6_interface_area,
   struct interface *ifp;
   u_int32_t area_id;
 
-  ifp = if_lookup_by_name (argv[idx_ifname]->arg);
+  ifp = if_lookup_by_name (argv[idx_ifname]->arg, VRF_DEFAULT);
   if (ifp == NULL)
     {
       vty_out (vty, "No such interface %s%s", argv[idx_ifname]->arg, VNL);
index 717dc25f94e7bbf1c3d7edc768af70ec67f0ce4e..db51abca230d832cb9f9586ac0b051563b8a171f 100644 (file)
@@ -32,6 +32,7 @@
 #include "command.h"
 #include "log.h"
 #include "plist.h"
+#include "vrf.h"
 
 #include "ospfd/ospfd.h"
 #include "ospfd/ospf_asbr.h"
@@ -360,7 +361,7 @@ route_match_interface (void *rule, struct prefix *prefix,
   if (type == RMAP_OSPF)
     {
       ei = object;
-      ifp = if_lookup_by_name ((char *)rule);
+      ifp = if_lookup_by_name ((char *)rule, VRF_DEFAULT);
 
       if (ifp == NULL || ifp->ifindex != ei->ifindex)
        return RMAP_NOMATCH;
index 4c5862e84a54bccb0b60d3591dad3b10be973907..449f9e7b97f7f7767bc529c6052f5bba9c1a4b0f 100644 (file)
@@ -2630,7 +2630,7 @@ DEFUN (show_ip_ospf_mpls_te_link,
   /* Interface name is specified. */
   else
     {
-      if ((ifp = if_lookup_by_name (argv[idx_interface]->arg)) == NULL)
+      if ((ifp = if_lookup_by_name (argv[idx_interface]->arg, VRF_DEFAULT)) == NULL)
         vty_out (vty, "No such interface name%s", VTY_NEWLINE);
       else
         show_mpls_te_link_sub (vty, ifp);
index 33fc0bf52538f4142695f8cf3a3d9ca0f7c78c55..cc3b47c0c4c5710dd02411f96dff34ebc2e7a548 100644 (file)
@@ -3592,7 +3592,7 @@ show_ip_ospf_interface_common (struct vty *vty, struct ospf *ospf, int argc,
   else
     {
       /* Interface name is specified. */
-      if ((ifp = if_lookup_by_name (argv[iface_argv]->arg)) == NULL)
+      if ((ifp = if_lookup_by_name (argv[iface_argv]->arg, VRF_DEFAULT)) == NULL)
         {
           if (use_json)
               json_object_boolean_true_add(json, "noSuchIface");
@@ -3950,7 +3950,7 @@ show_ip_ospf_neighbor_int_common (struct vty *vty, struct ospf *ospf, int arg_ba
                  VTY_NEWLINE, VTY_NEWLINE);
     }
 
-  ifp = if_lookup_by_name (argv[arg_base]->arg);
+  ifp = if_lookup_by_name (argv[arg_base]->arg, VRF_DEFAULT);
   if (!ifp)
     {
       if (use_json)
@@ -4609,7 +4609,7 @@ show_ip_ospf_neighbor_int_detail_common (struct vty *vty, struct ospf *ospf,
                  VTY_NEWLINE, VTY_NEWLINE);
     }
 
-  ifp = if_lookup_by_name (argv[arg_base]->arg);
+  ifp = if_lookup_by_name (argv[arg_base]->arg, VRF_DEFAULT);
   if (!ifp)
     {
       if (!use_json)
@@ -9142,7 +9142,7 @@ DEFUN (clear_ip_ospf_interface,
     }
   else /* Interface name is specified. */
     {
-      if ((ifp = if_lookup_by_name (argv[idx_ifname]->text)) == NULL)
+      if ((ifp = if_lookup_by_name (argv[idx_ifname]->text, VRF_DEFAULT)) == NULL)
         vty_out (vty, "No such interface name%s", VTY_NEWLINE);
       else
         ospf_interface_clear(ifp);
index 465c368f43476e1427d7d49868c9f6dedd3b5279..081f62b90bd7546280f70681fce6648617e2cbf1 100644 (file)
@@ -4418,7 +4418,7 @@ DEFUN (interface_ip_mroute,
    int               result;
 
    oifname = argv[idx_interface]->arg;
-   oif = if_lookup_by_name(oifname);
+   oif = if_lookup_by_name(oifname, VRF_DEFAULT);
    if (!oif) {
      vty_out(vty, "No such interface name %s%s",
         oifname, VTY_NEWLINE);
@@ -4465,7 +4465,7 @@ DEFUN (interface_ip_mroute_source,
    int               result;
 
    oifname = argv[idx_interface]->arg;
-   oif = if_lookup_by_name(oifname);
+   oif = if_lookup_by_name(oifname, VRF_DEFAULT);
    if (!oif) {
      vty_out(vty, "No such interface name %s%s",
         oifname, VTY_NEWLINE);
@@ -4516,7 +4516,7 @@ DEFUN (interface_no_ip_mroute,
    int               result;
 
    oifname = argv[idx_interface]->arg;
-   oif = if_lookup_by_name(oifname);
+   oif = if_lookup_by_name(oifname, VRF_DEFAULT);
    if (!oif) {
      vty_out(vty, "No such interface name %s%s",
         oifname, VTY_NEWLINE);
@@ -4564,7 +4564,7 @@ DEFUN (interface_no_ip_mroute_source,
    int               result;
 
    oifname = argv[idx_interface]->arg;
-   oif = if_lookup_by_name(oifname);
+   oif = if_lookup_by_name(oifname, VRF_DEFAULT);
    if (!oif) {
      vty_out(vty, "No such interface name %s%s",
         oifname, VTY_NEWLINE);
index 76687cea302dd4be2069031553c8c03e2919d99b..086479643166c5b03bc7e145e0ac31da5d3117ef 100644 (file)
@@ -858,7 +858,7 @@ pim_find_primary_addr (struct interface *ifp)
   if (!v4_addrs && v6_addrs && !if_is_loopback (ifp))
     {
       struct interface *lo_ifp;
-      lo_ifp = if_lookup_by_name_vrf ("lo", VRF_DEFAULT);
+      lo_ifp = if_lookup_by_name ("lo", VRF_DEFAULT);
       if (lo_ifp)
        return pim_find_primary_addr (lo_ifp);
     }
@@ -1005,7 +1005,7 @@ struct interface *pim_if_find_by_vif_index(ifindex_t vif_index)
   struct interface *ifp;
 
   if (vif_index == 0)
-    return if_lookup_by_name_vrf ("pimreg", VRF_DEFAULT);
+    return if_lookup_by_name ("pimreg", VRF_DEFAULT);
 
   for (ALL_LIST_ELEMENTS_RO (vrf_iflist (VRF_DEFAULT), ifnode, ifp)) {
     if (ifp->info) {
index 6fd647596cf1fe6052bd9874b5a858dd287e96dd..baba9592e04578270e1f3dce80288fd3ee8ab469 100644 (file)
@@ -31,6 +31,7 @@
 #include "log.h"
 #include "sockunion.h"         /* for inet_aton () */
 #include "plist.h"
+#include "vrf.h"
 
 #include "ripd/ripd.h"
 
@@ -136,7 +137,7 @@ route_match_interface (void *rule, struct prefix *prefix,
   if (type == RMAP_RIP)
     {
       ifname = rule;
-      ifp = if_lookup_by_name(ifname);
+      ifp = if_lookup_by_name(ifname, VRF_DEFAULT);
 
       if (!ifp)
        return RMAP_NOMATCH;
index abc2faf2e9acba5ff34e4232ac3a6637e28e4bf1..fab31b322ff9d24c160a61976ef08b1752e01407 100644 (file)
@@ -3763,7 +3763,7 @@ rip_distribute_update (struct distribute *dist)
   if (! dist->ifname)
     return;
 
-  ifp = if_lookup_by_name (dist->ifname);
+  ifp = if_lookup_by_name (dist->ifname, VRF_DEFAULT);
   if (ifp == NULL)
     return;
 
@@ -3962,7 +3962,7 @@ rip_if_rmap_update (struct if_rmap *if_rmap)
   struct rip_interface *ri;
   struct route_map *rmap;
 
-  ifp = if_lookup_by_name (if_rmap->ifname);
+  ifp = if_lookup_by_name (if_rmap->ifname, VRF_DEFAULT);
   if (ifp == NULL)
     return;
 
index 7cab5861bfe4fc6a9d5d88aeb8c33bd1bedcc6ee..ad8dbc92f39329b061f2ac4ff7954e28e78a5493 100644 (file)
@@ -110,7 +110,7 @@ route_match_interface (void *rule, struct prefix *prefix,
   if (type == RMAP_RIPNG)
     {
       ifname = rule;
-      ifp = if_lookup_by_name(ifname);
+      ifp = if_lookup_by_name(ifname, VRF_DEFAULT);
 
       if (!ifp)
        return RMAP_NOMATCH;
index 8e98f5b0ef8fb26850a31c1386e113726fd2a29e..591316e50ffc815e449e8d3fa9c35025790a29bc 100644 (file)
@@ -2814,7 +2814,7 @@ ripng_distribute_update (struct distribute *dist)
   if (! dist->ifname)
     return;
 
-  ifp = if_lookup_by_name (dist->ifname);
+  ifp = if_lookup_by_name (dist->ifname, VRF_DEFAULT);
   if (ifp == NULL)
     return;
 
@@ -3009,7 +3009,7 @@ ripng_if_rmap_update (struct if_rmap *if_rmap)
   struct ripng_interface *ri;
   struct route_map *rmap;
 
-  ifp = if_lookup_by_name (if_rmap->ifname);
+  ifp = if_lookup_by_name (if_rmap->ifname, VRF_DEFAULT);
   if (ifp == NULL)
     return;
 
index a4498a84f6fb07959341c72aafd4f5fbd47d9210..2393e0f9c5f5f3ccd6712f74271375b19816920e 100644 (file)
@@ -201,7 +201,7 @@ if_getaddrs (void)
           continue;
         }
        
-      ifp = if_lookup_by_name (ifap->ifa_name);
+      ifp = if_lookup_by_name (ifap->ifa_name, VRF_DEFAULT);
       if (ifp == NULL)
        {
          zlog_err ("if_getaddrs(): Can't lookup interface %s\n",
index 5a9de5b70b249ea5ce9b330f5b2a0cee2fe74007..902e53dc5ea4520efccadc3d5733c4d272db8519 100644 (file)
@@ -1320,7 +1320,7 @@ DEFUN (show_interface_name_vrf,
   VRF_GET_ID (vrf_id, argv[idx_name]->arg);
 
   /* Specified interface print. */
-  ifp = if_lookup_by_name_vrf (argv[idx_ifname]->arg, vrf_id);
+  ifp = if_lookup_by_name (argv[idx_ifname]->arg, vrf_id);
   if (ifp == NULL)
     {
       vty_out (vty, "%% Can't find interface %s%s", argv[idx_ifname]->arg,
@@ -1352,7 +1352,7 @@ DEFUN (show_interface_name_vrf_all,
   RB_FOREACH (vrf, vrf_name_head, &vrfs_by_name)
     {
       /* Specified interface print. */
-      ifp = if_lookup_by_name_vrf (argv[idx_ifname]->arg, vrf->vrf_id);
+      ifp = if_lookup_by_name (argv[idx_ifname]->arg, vrf->vrf_id);
       if (ifp)
         {
           if_dump_vty (vty, ifp);
index ad04e1a8a4f960ccdaf66e3bb4944a87d471d470..fee7bce1cd2b0fcda6f390927665b59de910134f 100644 (file)
@@ -487,7 +487,7 @@ ifm_read (struct if_msghdr *ifm)
    * be filled in.
    */
   if ( (ifp == NULL) && ifnlen)
-    ifp = if_lookup_by_name (ifname);
+    ifp = if_lookup_by_name (ifname, VRF_DEFAULT);
 
   /*
    * If ifp still does not exist or has an invalid index (IFINDEX_INTERNAL),
index 6fc41c3a1486595b573517095a0f0f13835da1cd..bc18ee5863650caee2eaa4f0a74522b3d55804d7 100644 (file)
@@ -171,7 +171,7 @@ zebra_vrf_enable (struct vrf *vrf)
              si->vrf_id = vrf->vrf_id;
              if (si->ifindex)
                {
-                 ifp = if_lookup_by_name_vrf (si->ifname, si->vrf_id);
+                 ifp = if_lookup_by_name (si->ifname, si->vrf_id);
                  if (ifp)
                    si->ifindex = ifp->ifindex;
                  else
index 7946089aea3604fa1ca0e08f557db63acbb4d8d3..1c315670bdf07f5d0853dc9b819805ba8a0896ea 100644 (file)
@@ -184,7 +184,7 @@ zebra_static_ipv4 (struct vty *vty, safi_t safi, int add_cmd,
   ret = inet_aton (gate_str, &gate);
   if (!ret)
     {
-      struct interface *ifp = if_lookup_by_name_vrf (gate_str, zvrf_id (zvrf));
+      struct interface *ifp = if_lookup_by_name (gate_str, zvrf_id (zvrf));
       if (!ifp)
         {
          vty_out (vty, "%% Unknown interface: %s%s", gate_str, VTY_NEWLINE);
@@ -2459,7 +2459,7 @@ static_ipv6_func (struct vty *vty, int add_cmd, const char *dest_str,
         }
       type = STATIC_IPV6_GATEWAY_IFINDEX;
       gate = &gate_addr;
-      ifp = if_lookup_by_name_vrf (ifname, zvrf_id (zvrf));
+      ifp = if_lookup_by_name (ifname, zvrf_id (zvrf));
       if (!ifp)
         {
           vty_out (vty, "%% Malformed Interface name %s%s", ifname, VTY_NEWLINE);
@@ -2477,7 +2477,7 @@ static_ipv6_func (struct vty *vty, int add_cmd, const char *dest_str,
       else
         {
           type = STATIC_IFINDEX;
-          ifp = if_lookup_by_name_vrf (gate_str, zvrf_id (zvrf));
+          ifp = if_lookup_by_name (gate_str, zvrf_id (zvrf));
           if (!ifp)
             {
               vty_out (vty, "%% Malformed Interface name %s%s", gate_str, VTY_NEWLINE);