diff options
author | Quentin Young <qlyoung@cumulusnetworks.com> | 2019-05-14 22:19:07 +0200 |
---|---|---|
committer | Quentin Young <qlyoung@cumulusnetworks.com> | 2019-05-14 23:23:08 +0200 |
commit | d8b87afe7c5fcee9caaef7124d5bcd5f0c3af8a1 (patch) | |
tree | ca07ea6097ec12120806ff4c7bd268b9fc063842 /pimd/pim_msdp.c | |
parent | Merge pull request #4335 from opensourcerouting/zebra-fpm-blackhole-info (diff) | |
download | frr-d8b87afe7c5fcee9caaef7124d5bcd5f0c3af8a1.tar.xz frr-d8b87afe7c5fcee9caaef7124d5bcd5f0c3af8a1.zip |
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 'pimd/pim_msdp.c')
-rw-r--r-- | pimd/pim_msdp.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/pimd/pim_msdp.c b/pimd/pim_msdp.c index 395c4af35..3287e1371 100644 --- a/pimd/pim_msdp.c +++ b/pimd/pim_msdp.c @@ -680,9 +680,9 @@ void pim_msdp_up_del(struct pim_instance *pim, struct prefix_sg *sg) } /* sa hash and peer list helpers */ -static unsigned int pim_msdp_sa_hash_key_make(void *p) +static unsigned int pim_msdp_sa_hash_key_make(const void *p) { - struct pim_msdp_sa *sa = p; + const struct pim_msdp_sa *sa = p; return (jhash_2words(sa->sg.src.s_addr, sa->sg.grp.s_addr, 0)); } @@ -1215,9 +1215,9 @@ enum pim_msdp_err pim_msdp_peer_del(struct pim_instance *pim, } /* peer hash and peer list helpers */ -static unsigned int pim_msdp_peer_hash_key_make(void *p) +static unsigned int pim_msdp_peer_hash_key_make(const void *p) { - struct pim_msdp_peer *mp = p; + const struct pim_msdp_peer *mp = p; return (jhash_1word(mp->peer.s_addr, 0)); } |