From: Donald Sharp Date: Tue, 30 Apr 2019 23:40:11 +0000 (-0400) Subject: lib: Make prefix_hash_key accept a const X-Git-Tag: base_7.2~373^2~2 X-Git-Url: https://git.puffer.fish/?a=commitdiff_plain;h=62b4b3b68dc1991e31514167a180cf752d24dc5c;p=matthieu%2Ffrr.git lib: Make prefix_hash_key accept a const We should not be modifying the pointer for the prefix_hash_key function, make it a const so that we can use it elsewhere. Signed-off-by: Donald Sharp --- diff --git a/lib/prefix.c b/lib/prefix.c index 6b91969218..d2a4c3a432 100644 --- a/lib/prefix.c +++ b/lib/prefix.c @@ -1543,7 +1543,7 @@ char *prefix_mac2str(const struct ethaddr *mac, char *buf, int size) return ptr; } -unsigned prefix_hash_key(void *pp) +unsigned prefix_hash_key(const void *pp) { struct prefix copy; diff --git a/lib/prefix.h b/lib/prefix.h index d3c387e102..d57b43dac6 100644 --- a/lib/prefix.h +++ b/lib/prefix.h @@ -466,7 +466,7 @@ extern int is_zero_mac(struct ethaddr *mac); extern int prefix_str2mac(const char *str, struct ethaddr *mac); extern char *prefix_mac2str(const struct ethaddr *mac, char *buf, int size); -extern unsigned prefix_hash_key(void *pp); +extern unsigned prefix_hash_key(const void *pp); extern int str_to_esi(const char *str, esi_t *esi); extern char *esi_to_str(const esi_t *esi, char *buf, int size);