[systemd-devel] [PATCH] network: allow domain names up to 255 characters

Lennart Poettering lennart at poettering.net
Tue Apr 14 05:07:45 PDT 2015


On Mon, 13.04.15 10:09, Nick Owens (mischief at offblast.org) wrote:

> > Hmm, so the DHCP spec explicitly declares that options 15 and 12 are
> > about the DNS hostname, where RFC 1035 is normative. Our function
> > hostname_is_valid() currently does not validate host names according
> > to RFC 1035, but is in some way stricter (by enforcing Linux' own semantics
> > on the length, and by limiting the charset drastically) and in other
> > ways less strict (by not enforce label length.)
> >
> > I am pretty sure we should leave hostname_is_valid() the way it is, to
> > be used when setting local hostnames and things like that. However,
> > the DHCP code should really validate according to RFC 1035 instead,
> > since that's what the spec says...
> >
> > Implementation-wise this probably means we should move
> > src/resolve/resolved-dns-domain.[ch] into src/shared/dns-domain.[ch]
> > and then add a call there that works similar to dns_name_normalize()
> > but doesn't actually normalize, but simply validates.
> 
> the intention of the domainname_is_valid function in this patch is to
> validate domain names, which can be up to 255 octets. there appears to
> be no standardized macro for this size, so i added one.

Well, I understand that. But I'd prefer if we could reuse the DNS
domain parsing code for this we already have instead of adding yet
another function for validating this.

I hope that makese sense,

Lennart

-- 
Lennart Poettering, Red Hat


More information about the systemd-devel mailing list