From 9af79429257d4df5d3dc19b597455a807c7c5c9d Mon Sep 17 00:00:00 2001
From: Dan Dubovik <ddubovik@godaddy.com>
Date: Fri, 4 Jul 2014 19:34:40 -0700
Subject: [PATCH] bug: backend: Fix method declaration for map_get_server_hash

In the backend code, when using the djb2 hash, we are not using the unsigned long that the hash is generated as when selecting a server.  This patch fixes the declaration of map_get_server_hash to use an unsigned long instead of an unsigned int.
---
 include/proto/lb_map.h | 2 +-
 src/lb_map.c           | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/include/proto/lb_map.h b/include/proto/lb_map.h
index 061273d..8bad685 100644
--- a/include/proto/lb_map.h
+++ b/include/proto/lb_map.h
@@ -31,7 +31,7 @@ void map_set_server_status_up(struct server *srv);
 void recalc_server_map(struct proxy *px);
 void init_server_map(struct proxy *p);
 struct server *map_get_server_rr(struct proxy *px, struct server *srvtoavoid);
-struct server *map_get_server_hash(struct proxy *px, unsigned int hash);
+struct server *map_get_server_hash(struct proxy *px, unsigned long hash);
 
 #endif /* _PROTO_LB_MAP_H */
 
diff --git a/src/lb_map.c b/src/lb_map.c
index be61b77..7e41612 100644
--- a/src/lb_map.c
+++ b/src/lb_map.c
@@ -251,7 +251,7 @@ struct server *map_get_server_rr(struct proxy *px, struct server *srvtoavoid)
  * be recomputed if required before being looked up. If any server is found, it
  * will be returned.  If no valid server is found, NULL is returned.
  */
-struct server *map_get_server_hash(struct proxy *px, unsigned int hash)
+struct server *map_get_server_hash(struct proxy *px, unsigned long hash)
 {
 	if (px->lbprm.tot_weight == 0)
 		return NULL;
-- 
1.8.3.4 (Apple Git-47)

