diff options
author | Philippe Guibert <philippe.guibert@6wind.com> | 2019-02-11 15:46:48 +0100 |
---|---|---|
committer | Philippe Guibert <philippe.guibert@6wind.com> | 2019-06-12 08:37:54 +0200 |
commit | f11e98eca3c4b4e3c91c826329018e848bcb9fc6 (patch) | |
tree | ace27e5cf229093071ea7f0c00029920b4d8c46e /ospfd | |
parent | lib, ospfd, pimd, zebra: change if_create() api with vrf (diff) | |
download | frr-f11e98eca3c4b4e3c91c826329018e848bcb9fc6.tar.xz frr-f11e98eca3c4b4e3c91c826329018e848bcb9fc6.zip |
*: change if_lookup_by_name() api with vrf
the vrf_id parameter is replaced by struct vrf * parameter.
this impacts most of the daemons that look for an interface based on the
name and the vrf identifier.
Also, it fixes 2 lookup calls in zebra and sharpd, where the vrf_id was
ignored until now.
Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
Diffstat (limited to 'ospfd')
-rw-r--r-- | ospfd/ospf_te.c | 2 | ||||
-rw-r--r-- | ospfd/ospf_vty.c | 18 | ||||
-rw-r--r-- | ospfd/ospf_zebra.c | 3 |
3 files changed, 15 insertions, 8 deletions
diff --git a/ospfd/ospf_te.c b/ospfd/ospf_te.c index e68363663..52ec97e34 100644 --- a/ospfd/ospf_te.c +++ b/ospfd/ospf_te.c @@ -2569,7 +2569,7 @@ DEFUN (show_ip_ospf_mpls_te_link, if (idx_interface) { ifp = if_lookup_by_name( argv[idx_interface]->arg, - ospf->vrf_id); + vrf_lookup_by_id(ospf->vrf_id)); if (ifp == NULL) { vty_out(vty, "No such interface name in vrf %s\n", vrf->name); diff --git a/ospfd/ospf_vty.c b/ospfd/ospf_vty.c index a2444c9ea..e2ddf36a3 100644 --- a/ospfd/ospf_vty.c +++ b/ospfd/ospf_vty.c @@ -3741,7 +3741,8 @@ static int show_ip_ospf_interface_common(struct vty *vty, struct ospf *ospf, json_interface); } else { /* Interface name is specified. */ - ifp = if_lookup_by_name(intf_name, ospf->vrf_id); + ifp = if_lookup_by_name(intf_name, + vrf_lookup_by_id(ospf->vrf_id)); if (ifp == NULL) { if (use_json) json_object_boolean_true_add(json_vrf, @@ -3881,7 +3882,8 @@ static int show_ip_ospf_interface_traffic_common( } } else { /* Interface name is specified. */ - ifp = if_lookup_by_name(intf_name, ospf->vrf_id); + ifp = if_lookup_by_name(intf_name, + vrf_lookup_by_id(ospf->vrf_id)); if (ifp != NULL) { struct route_node *rn; struct ospf_interface *oi; @@ -4691,7 +4693,8 @@ static int show_ip_ospf_neighbor_int_common(struct vty *vty, struct ospf *ospf, ospf_show_vrf_name(ospf, vty, json, use_vrf); - ifp = if_lookup_by_name(argv[arg_base]->arg, ospf->vrf_id); + ifp = if_lookup_by_name(argv[arg_base]->arg, + vrf_lookup_by_id(ospf->vrf_id)); if (!ifp) { if (use_json) json_object_boolean_true_add(json, "noSuchIface"); @@ -4759,7 +4762,8 @@ DEFUN (show_ip_ospf_neighbor_int, argv_find(argv, argc, "IFNAME", &idx_ifname); - ifp = if_lookup_by_name(argv[idx_ifname]->arg, vrf_id); + ifp = if_lookup_by_name(argv[idx_ifname]->arg, + vrf_lookup_by_id(vrf_id)); if (!ifp) return ret; @@ -5576,7 +5580,8 @@ static int show_ip_ospf_neighbor_int_detail_common(struct vty *vty, vty_out(vty, "\nOSPF Instance: %d\n\n", ospf->instance); } - ifp = if_lookup_by_name(argv[arg_base]->arg, ospf->vrf_id); + ifp = if_lookup_by_name(argv[arg_base]->arg, + vrf_lookup_by_id(ospf->vrf_id)); if (!ifp) { if (!use_json) vty_out(vty, "No such interface.\n"); @@ -10684,7 +10689,8 @@ DEFUN (clear_ip_ospf_interface, } } else { /* Interface name is specified. */ - ifp = if_lookup_by_name(argv[idx_ifname]->arg, vrf_id); + ifp = if_lookup_by_name(argv[idx_ifname]->arg, + vrf_lookup_by_id(vrf_id)); if (ifp == NULL) vty_out(vty, "No such interface name\n"); else diff --git a/ospfd/ospf_zebra.c b/ospfd/ospf_zebra.c index c178e367d..9db89faa9 100644 --- a/ospfd/ospf_zebra.c +++ b/ospfd/ospf_zebra.c @@ -175,7 +175,8 @@ static struct interface *zebra_interface_if_lookup(struct stream *s, stream_get(ifname_tmp, s, INTERFACE_NAMSIZ); /* And look it up. */ - return if_lookup_by_name(ifname_tmp, vrf_id); + return if_lookup_by_name(ifname_tmp, + vrf_lookup_by_id(vrf_id)); } static int ospf_interface_state_up(ZAPI_CALLBACK_ARGS) |