From: Lennart Poettering Date: Sun, 14 Aug 2005 00:56:25 +0000 (+0000) Subject: * allow SRV records with port == 0 (for flagship naming) X-Git-Url: https://git.meshlink.io/?a=commitdiff_plain;h=b789f76475170c84fce85383279aa8f683ad1ff9;p=catta * allow SRV records with port == 0 (for flagship naming) git-svn-id: file:///home/lennart/svn/public/avahi/trunk@312 941a03a8-eaeb-0310-b9a0-b1bbd8fe43fe --- diff --git a/avahi-core/server.c b/avahi-core/server.c index ae0b1e6..ca5da5d 100644 --- a/avahi-core/server.c +++ b/avahi-core/server.c @@ -1833,9 +1833,6 @@ static int server_add_service_strlst_nocopy( if (host && !avahi_is_valid_domain_name(host)) return avahi_server_set_errno(s, AVAHI_ERR_INVALID_HOST_NAME); - if (port == 0) - return avahi_server_set_errno(s, AVAHI_ERR_INVALID_PORT); - escape_service_name(ename, sizeof(ename), name); if (!domain) @@ -1997,12 +1994,12 @@ int avahi_server_add_dns_server_address( assert(type == AVAHI_DNS_SERVER_UPDATE || type == AVAHI_DNS_SERVER_RESOLVE); assert(address->family == AVAHI_PROTO_INET || address->family == AVAHI_PROTO_INET6); - if (domain && !avahi_is_valid_domain_name(domain)) - return avahi_server_set_errno(s, AVAHI_ERR_INVALID_DOMAIN_NAME); - if (port == 0) return avahi_server_set_errno(s, AVAHI_ERR_INVALID_PORT); + if (domain && !avahi_is_valid_domain_name(domain)) + return avahi_server_set_errno(s, AVAHI_ERR_INVALID_DOMAIN_NAME); + if (address->family == AVAHI_PROTO_INET) { hexstring(n+3, sizeof(n)-3, &address->data, 4); r = avahi_record_new_full(n, AVAHI_DNS_CLASS_IN, AVAHI_DNS_TYPE_A, AVAHI_DEFAULT_TTL_HOST_NAME); diff --git a/avahi-daemon/static-services.c b/avahi-daemon/static-services.c index ff2602f..03824fd 100644 --- a/avahi-daemon/static-services.c +++ b/avahi-daemon/static-services.c @@ -349,7 +349,7 @@ static void XMLCALL xml_end(void *data, const char *el) { case XML_TAG_SERVICE: - if (u->service->port == 0 || !u->service->type) { + if (!u->service->type) { avahi_log_error("%s: parse failure: service incomplete.", u->group->filename); u->failed = TRUE; return; @@ -369,7 +369,7 @@ static void XMLCALL xml_end(void *data, const char *el) { p = u->buf ? atoi(u->buf) : 0; - if (p <= 0 || p > 0xFFFF) { + if (p < 0 || p > 0xFFFF) { avahi_log_error("%s: parse failure: invalid port specification \"%s\".", u->group->filename, u->buf); u->failed = TRUE; return; diff --git a/docs/TODO b/docs/TODO index aeca215..4670224 100644 --- a/docs/TODO +++ b/docs/TODO @@ -1,10 +1,10 @@ todo: -* drop glib from avahi-daemon -* allow srv port == 0 * deal with no local interface ? +* doxygen updates * release! later: +* drop glib from avahi-daemon * support for special domain PTR records based on local IP subnet address * Changes resulting in updated RFC of 7th June 2005: * Defer responses to replies with TC bit set by 400-500msec @@ -51,3 +51,4 @@ done: * add entry_group::reset() * add internal error codes * finish DBUS stuff: allow NUL bytes in TXT records +* allow srv port == 0