mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-04 04:04:09 +00:00
*: Refactor if_lookup_by_name to be VRF aware
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
This commit is contained in:
parent
a90607a4ba
commit
1306c09a1b
@ -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;
|
||||
|
||||
|
@ -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,
|
||||
|
@ -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
|
||||
|
@ -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);
|
||||
|
@ -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;
|
||||
|
20
lib/if.c
20
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)
|
||||
{
|
||||
|
5
lib/if.h
5
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);
|
||||
|
||||
|
@ -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: {
|
||||
|
@ -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)
|
||||
|
@ -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;
|
||||
|
@ -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);
|
||||
|
@ -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;
|
||||
|
@ -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);
|
||||
|
@ -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);
|
||||
|
@ -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);
|
||||
|
@ -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) {
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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",
|
||||
|
@ -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);
|
||||
|
@ -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),
|
||||
|
@ -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
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user