Skip to content

[th/host-name-max-as-64] all: hardcode HOST_NAME_MAX to 64

Thomas Haller requested to merge th/host-name-max-as-64 into main

On glibc, HOST_NAME_MAX is defined as 64. Also, Linux' sethostname() enforces that limit (__NEW_UTS_LEN). Also, man gethostname comments that HOST_NAME_MAX on Linux is 64.

However, when building against musl, HOST_NAME_MAX is defined as 255. That seems wrong. We use this limit to validate the hostname, and that should not depend on the libc or on the compilation.

Hardcode the value to 64.

Merge request reports