1 From e77015cdc18ab74aba61cdf57de56d06be5c2a4d Mon Sep 17 00:00:00 2001
2 From: Willy Tarreau <w@1wt.eu>
3 Date: Wed, 14 Jan 2015 11:48:58 +0100
4 Subject: [PATCH 05/10] MINOR: config: extend the default max hostname length
7 Some users reported that the default max hostname length of 32 is too
8 short in some environments. This patch does two things :
10 - it relies on the system's max hostname length as found in MAXHOSTNAMELEN
11 if it is set. This is the most logical thing to do as the system libs
12 generally present the appropriate value supported by the system. This
13 value is 64 on Linux and 256 on Solaris, to give a few examples.
15 - otherwise it defaults to 64
17 It is still possible to override this value by defining MAX_HOSTNAME_LEN at
18 build time. After some observation time, this patch may be backported to
19 1.5 if it does not cause any build issue, as it is harmless and may help
21 (cherry picked from commit 75abcb3106e2c27ef983df885558cf94e01f717a)
23 Cc: Lukas Tribus <luky-37@hotmail.com>
24 Cc: jose.castro.leon@cern.ch
26 [wt: no issue reported so far and Jose rightfully asked for it in 1.5]
28 include/common/defaults.h | 8 ++++++--
29 1 file changed, 6 insertions(+), 2 deletions(-)
31 diff --git a/include/common/defaults.h b/include/common/defaults.h
32 index 0075509..a191b8a 100644
33 --- a/include/common/defaults.h
34 +++ b/include/common/defaults.h
37 /* Maximum host name length */
38 #ifndef MAX_HOSTNAME_LEN
39 -#define MAX_HOSTNAME_LEN 32
42 +#define MAX_HOSTNAME_LEN MAXHOSTNAMELEN
44 +#define MAX_HOSTNAME_LEN 64
45 +#endif // MAXHOSTNAMELEN
46 +#endif // MAX_HOSTNAME_LEN
48 /* Maximum health check description length */