diff options
author | Luca Bruno <luca.bruno@coreos.com> | 2017-12-13 17:00:46 +0000 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2017-12-13 18:00:46 +0100 |
commit | 2de2abad62d4f23f7d9af0c3871f9955896d085c (patch) | |
tree | d449365dfbc974b187caf7cac3c493f698bcc4be /src/basic/hostname-util.h | |
parent | 3ce5a5df2cfb570ee30b86d1dd47f6cea452115a (diff) | |
download | systemd-2de2abad62d4f23f7d9af0c3871f9955896d085c.tar.gz |
networkd/dhcp: shorten overlong hostname (#7616)
This commit updates networkd behavior to check if the hostname option
received via DHCP is too long for Linux limit, and in case shorten it.
An overlong hostname will be truncated to the first dot or to
`HOST_MAX_LEN`, whatever comes earlier.
Diffstat (limited to 'src/basic/hostname-util.h')
-rw-r--r-- | src/basic/hostname-util.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/basic/hostname-util.h b/src/basic/hostname-util.h index 52fd6b0899..d837d6f28c 100644 --- a/src/basic/hostname-util.h +++ b/src/basic/hostname-util.h @@ -39,5 +39,7 @@ bool is_gateway_hostname(const char *hostname); int sethostname_idempotent(const char *s); +int shorten_overlong(const char *s, char **ret); + int read_etc_hostname_stream(FILE *f, char **ret); int read_etc_hostname(const char *path, char **ret); |