[avahi] compound hostname causes avahi core failure
Troyanker, Vlad
vlad at lab126.com
Wed Mar 27 19:39:46 PDT 2013
We build avahi 0.6.31. When I changed my hostname from <hostname> to
<hostname>.<blah>.<domain>.com as mandated by our company IT, avahi core
fails to initialize with 'Invalid host name' error. I tracked it down to
function avahi_is_valid_host_name() in domain.c
The very last condition returns 0 as 't' is pointing to <blah>. I wonder
what is the purpose of that conditional and why cannot avahi handle
compound hostname?
Int avahi_is_valid_host_name(const char *t) {
char label[AVAHI_LABEL_MAX];
assert(t);
if (strlen(t) >= AVAHI_DOMAIN_NAME_MAX || !*t)
return 0;
if (!(avahi_unescape_label(&t, label, sizeof(label))))
return 0;
if (strlen(label) < 1)
return 0;
if (*t)
return 0;
return 1;
}
More information about the avahi
mailing list