]> git.puffer.fish Git - mirror/frr.git/commitdiff
lib: fix for dynamically grown hashes
authorJorge Boncompte [DTI2] <jorge@dti2.net>
Wed, 31 Jul 2013 15:01:18 +0000 (15:01 +0000)
committerDavid Lamparter <equinox@opensourcerouting.org>
Tue, 1 Apr 2014 15:13:02 +0000 (17:13 +0200)
Fixes commit 97c84db00c (hash: dynamically grow hash table). The
no_expand field it's not initialized and could make the hashes to
never grow the table index.

Signed-off-by: Jorge Boncompte [DTI2] <jorge@dti2.net>
Acked-by: Feng Lu <lu.feng@6wind.com>
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
lib/hash.c

index 987012a58833223d23c0e280c5060e7b9148e13c..56e41fa82605a924139aeec37708ad8914f65788 100644 (file)
@@ -36,6 +36,7 @@ hash_create_size (unsigned int size, unsigned int (*hash_key) (void *),
   hash->index = XCALLOC (MTYPE_HASH_INDEX,
                         sizeof (struct hash_backet *) * size);
   hash->size = size;
+  hash->no_expand = 0;
   hash->hash_key = hash_key;
   hash->hash_cmp = hash_cmp;
   hash->count = 0;