diff options
author | Lennart Poettering <lennart@poettering.net> | 2015-12-02 20:16:23 +0100 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2015-12-02 20:16:23 +0100 |
commit | 5449f1e3312e5467ce321fc2d7aa16a0ce0c60d2 (patch) | |
tree | 7e328a8faafdffc3f383a40d472b40ad699ad1f7 /src/shared/dns-domain.h | |
parent | 1eb30a4c5c14a3aa11eeb8bbee6e0fcef7eaee29 (diff) | |
parent | 6344f3e28dd6ae341015d62163437f6cb1add749 (diff) |
Merge pull request #2073 from poettering/dns-label-fixes
Dns label fixes + unrelated selinux clean-up
Diffstat (limited to 'src/shared/dns-domain.h')
-rw-r--r-- | src/shared/dns-domain.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/shared/dns-domain.h b/src/shared/dns-domain.h index 99c72574db..44a9975541 100644 --- a/src/shared/dns-domain.h +++ b/src/shared/dns-domain.h @@ -25,9 +25,15 @@ #include "hashmap.h" #include "in-addr-util.h" +/* Length of a single label, with all escaping removed, excluding any trailing dot or NUL byte */ #define DNS_LABEL_MAX 63 + +/* Worst case length of a single label, with all escaping applied and room for a trailing NUL byte. */ #define DNS_LABEL_ESCAPED_MAX (DNS_LABEL_MAX*4+1) +/* Maximum length of a full hostname, consisting of a series of unescaped labels, and no trailing dot or NUL byte */ +#define DNS_HOSTNAME_MAX 253 + int dns_label_unescape(const char **name, char *dest, size_t sz); int dns_label_unescape_suffix(const char *name, const char **label_end, char *dest, size_t sz); int dns_label_escape(const char *p, size_t l, char *dest, size_t sz); |