diff options
author | hasso <hasso> | 2005-09-28 18:45:54 +0000 |
---|---|---|
committer | hasso <hasso> | 2005-09-28 18:45:54 +0000 |
commit | 3fdb2dd9dd8b4ab3517896092dd1b677d191adf9 (patch) | |
tree | 2f2bdff0a3797517100d0f1319cd3e46bb00f53f /isisd/isis_circuit.c | |
parent | d3d7474ba98f01e6d9994ff48c0b3a4331a8ef2a (diff) |
* *.c: Massive cleanup of lists loops. Stop abusing ALL_LIST_ELEMENTS.
Replace XMALLOC + memset with XCALLOC. Fix some indentation issues.
The only really significant change is simplified isis_delete_adj
function in isis_adjacency.c.
Diffstat (limited to 'isisd/isis_circuit.c')
-rw-r--r-- | isisd/isis_circuit.c | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/isisd/isis_circuit.c b/isisd/isis_circuit.c index 23cb0ac7..ee73dc44 100644 --- a/isisd/isis_circuit.c +++ b/isisd/isis_circuit.c @@ -66,10 +66,9 @@ isis_circuit_new () struct isis_circuit *circuit; int i; - circuit = XMALLOC (MTYPE_ISIS_CIRCUIT, sizeof (struct isis_circuit)); + circuit = XCALLOC (MTYPE_ISIS_CIRCUIT, sizeof (struct isis_circuit)); if (circuit) { - memset (circuit, 0, sizeof (struct isis_circuit)); /* set default metrics for circuit */ for (i = 0; i < 2; i++) { @@ -621,14 +620,13 @@ isis_interface_config_write (struct vty *vty) { int write = 0; - struct listnode *node, *nnode; - struct listnode *node2, *nnode2; + struct listnode *node, *node2; struct interface *ifp; struct isis_area *area; struct isis_circuit *c; int i; - for (ALL_LIST_ELEMENTS (iflist, node, nnode, ifp)) + for (ALL_LIST_ELEMENTS_RO (iflist, node, ifp)) { /* IF name */ vty_out (vty, "interface %s%s", ifp->name, VTY_NEWLINE); @@ -640,7 +638,7 @@ isis_interface_config_write (struct vty *vty) write++; } /* ISIS Circuit */ - for (ALL_LIST_ELEMENTS (isis->area_list, node2, nnode2, area)) + for (ALL_LIST_ELEMENTS_RO (isis->area_list, node2, area)) { c = circuit_lookup_by_ifp (ifp, area->circuit_list); if (c) @@ -892,7 +890,7 @@ DEFUN (no_ip_router_isis, struct isis_circuit *circuit = NULL; struct interface *ifp; struct isis_area *area; - struct listnode *node, *nnode; + struct listnode *node; ifp = (struct interface *) vty->index; assert (ifp); @@ -903,7 +901,7 @@ DEFUN (no_ip_router_isis, vty_out (vty, "Can't find ISIS instance %s", VTY_NEWLINE); return CMD_WARNING; } - for (ALL_LIST_ELEMENTS (area->circuit_list, node, nnode, circuit)) + for (ALL_LIST_ELEMENTS_RO (area->circuit_list, node, circuit)) if (circuit->interface == ifp) break; if (!circuit) |