diff options
| author | Quentin Young <qlyoung@cumulusnetworks.com> | 2019-05-14 20:19:07 +0000 |
|---|---|---|
| committer | Quentin Young <qlyoung@cumulusnetworks.com> | 2019-05-14 21:23:08 +0000 |
| commit | d8b87afe7c5fcee9caaef7124d5bcd5f0c3af8a1 (patch) | |
| tree | ca07ea6097ec12120806ff4c7bd268b9fc063842 /isisd/fabricd.c | |
| parent | ab78033d65dfcdbd5d1fe952193fc302b9843724 (diff) | |
lib: hashing functions should take const arguments
It doesn't make much sense for a hash function to modify its argument,
so const the hash input.
BGP does it in a couple places, those cast away the const. Not great but
not any worse than it was.
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
Diffstat (limited to 'isisd/fabricd.c')
| -rw-r--r-- | isisd/fabricd.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/isisd/fabricd.c b/isisd/fabricd.c index 96af28f0a1..b9c27d51bd 100644 --- a/isisd/fabricd.c +++ b/isisd/fabricd.c @@ -108,9 +108,9 @@ static void neighbor_lists_clear(struct fabricd *f) hash_clean(f->neighbors_neighbors, neighbor_entry_del_void); } -static unsigned neighbor_entry_hash_key(void *np) +static unsigned neighbor_entry_hash_key(const void *np) { - struct neighbor_entry *n = np; + const struct neighbor_entry *n = np; return jhash(n->id, sizeof(n->id), 0x55aa5a5a); } |
