diff options
author | hasso <hasso> | 2005-09-28 20:45:54 +0200 |
---|---|---|
committer | hasso <hasso> | 2005-09-28 20:45:54 +0200 |
commit | 3fdb2dd9dd8b4ab3517896092dd1b677d191adf9 (patch) | |
tree | 2f2bdff0a3797517100d0f1319cd3e46bb00f53f /isisd/isis_adjacency.c | |
parent | * isis_dynh.c, isisd.h: Implement dynamic hostname cache cleanup. (diff) | |
download | frr-3fdb2dd9dd8b4ab3517896092dd1b677d191adf9.tar.xz frr-3fdb2dd9dd8b4ab3517896092dd1b677d191adf9.zip |
* *.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_adjacency.c')
-rw-r--r-- | isisd/isis_adjacency.c | 29 |
1 files changed, 6 insertions, 23 deletions
diff --git a/isisd/isis_adjacency.c b/isisd/isis_adjacency.c index 3d847732c..a898f24ba 100644 --- a/isisd/isis_adjacency.c +++ b/isisd/isis_adjacency.c @@ -109,7 +109,6 @@ isis_adj_lookup (u_char * sysid, struct list *adjdb) return NULL; } - struct isis_adjacency * isis_adj_lookup_snpa (u_char * ssnpa, struct list *adjdb) { @@ -123,23 +122,14 @@ isis_adj_lookup_snpa (u_char * ssnpa, struct list *adjdb) return NULL; } -/* - * When we recieve a NULL list, we will know its p2p - */ void isis_delete_adj (struct isis_adjacency *adj, struct list *adjdb) { - struct isis_adjacency *adj2 = NULL; - struct listnode *node; - + if (!adj) + return; + /* When we recieve a NULL list, we will know its p2p. */ if (adjdb) - { - for (ALL_LIST_ELEMENTS_RO (adjdb, node, adj2)) - if (adj2 == adj) - break; - - listnode_delete (adjdb, adj); - } + listnode_delete (adjdb, adj); if (adj->ipv4_addrs) list_delete (adj->ipv4_addrs); @@ -147,15 +137,8 @@ isis_delete_adj (struct isis_adjacency *adj, struct list *adjdb) if (adj->ipv6_addrs) list_delete (adj->ipv6_addrs); #endif - if (adj) - { - XFREE (MTYPE_ISIS_ADJACENCY, adj); - } - else - { - zlog_warn ("tried to delete a non-existent adjacency"); - } - + + XFREE (MTYPE_ISIS_ADJACENCY, adj); return; } |