summaryrefslogtreecommitdiffstats
path: root/isisd
diff options
context:
space:
mode:
authorMark Stapp <mjs@voltanet.io>2021-11-16 17:45:43 +0100
committerGitHub <noreply@github.com>2021-11-16 17:45:43 +0100
commitab7e3ba180581933c32ab4ab9c8325e55a8b0e85 (patch)
tree1356287bf1c140e41d5303942b991579a39d1697 /isisd
parentMerge pull request #10064 from idryzhov/ospf-grace-period (diff)
parentfabricd: cleanup interface config output (diff)
downloadfrr-ab7e3ba180581933c32ab4ab9c8325e55a8b0e85.tar.xz
frr-ab7e3ba180581933c32ab4ab9c8325e55a8b0e85.zip
Merge pull request #9935 from idryzhov/fabricd-ifconf-cleanup
fabricd: cleanup interface config output
Diffstat (limited to 'isisd')
-rw-r--r--isisd/isis_circuit.c39
-rw-r--r--isisd/isis_circuit.h2
2 files changed, 6 insertions, 35 deletions
diff --git a/isisd/isis_circuit.c b/isisd/isis_circuit.c
index 8810d6107..d0e8637c5 100644
--- a/isisd/isis_circuit.c
+++ b/isisd/isis_circuit.c
@@ -268,24 +268,6 @@ void isis_circuit_deconfigure(struct isis_circuit *circuit,
return;
}
-struct isis_circuit *circuit_lookup_by_ifp(struct interface *ifp,
- struct list *list)
-{
- struct isis_circuit *circuit = NULL;
- struct listnode *node;
-
- if (!list)
- return NULL;
-
- for (ALL_LIST_ELEMENTS_RO(list, node, circuit))
- if (circuit->interface == ifp) {
- assert(ifp->info == circuit);
- return circuit;
- }
-
- return NULL;
-}
-
struct isis_circuit *circuit_scan_by_ifp(struct interface *ifp)
{
return (struct isis_circuit *)ifp->info;
@@ -1073,17 +1055,9 @@ static int isis_interface_config_write(struct vty *vty)
{
struct vrf *vrf = vrf_lookup_by_id(VRF_DEFAULT);
int write = 0;
- struct listnode *node;
struct interface *ifp;
- struct isis_area *area;
struct isis_circuit *circuit;
int i;
- struct isis *isis = NULL;
-
- isis = isis_lookup_by_vrfid(vrf->vrf_id);
-
- if (isis == NULL)
- return 0;
FOR_ALL_INTERFACES (vrf, ifp) {
/* IF name */
@@ -1095,14 +1069,13 @@ static int isis_interface_config_write(struct vty *vty)
write++;
}
/* ISIS Circuit */
- for (ALL_LIST_ELEMENTS_RO(isis->area_list, node, area)) {
- circuit =
- circuit_lookup_by_ifp(ifp, area->circuit_list);
+ do {
+ circuit = circuit_scan_by_ifp(ifp);
if (circuit == NULL)
- continue;
+ break;
if (circuit->ip_router) {
vty_out(vty, " ip router " PROTO_NAME " %s\n",
- area->area_tag);
+ circuit->tag);
write++;
}
if (circuit->is_passive) {
@@ -1115,7 +1088,7 @@ static int isis_interface_config_write(struct vty *vty)
}
if (circuit->ipv6_router) {
vty_out(vty, " ipv6 router " PROTO_NAME " %s\n",
- area->area_tag);
+ circuit->tag);
write++;
}
@@ -1295,7 +1268,7 @@ static int isis_interface_config_write(struct vty *vty)
}
write += hook_call(isis_circuit_config_write,
circuit, vty);
- }
+ } while (0);
vty_endframe(vty, "exit\n!\n");
}
diff --git a/isisd/isis_circuit.h b/isisd/isis_circuit.h
index e286194d3..746578084 100644
--- a/isisd/isis_circuit.h
+++ b/isisd/isis_circuit.h
@@ -186,8 +186,6 @@ DECLARE_QOBJ_TYPE(isis_circuit);
void isis_circuit_init(void);
struct isis_circuit *isis_circuit_new(struct interface *ifp, const char *tag);
void isis_circuit_del(struct isis_circuit *circuit);
-struct isis_circuit *circuit_lookup_by_ifp(struct interface *ifp,
- struct list *list);
struct isis_circuit *circuit_scan_by_ifp(struct interface *ifp);
void isis_circuit_configure(struct isis_circuit *circuit,
struct isis_area *area);