]> git.meshlink.io Git - catta/commitdiff
* allow SRV records with port == 0 (for flagship naming)
authorLennart Poettering <lennart@poettering.net>
Sun, 14 Aug 2005 00:56:25 +0000 (00:56 +0000)
committerLennart Poettering <lennart@poettering.net>
Sun, 14 Aug 2005 00:56:25 +0000 (00:56 +0000)
git-svn-id: file:///home/lennart/svn/public/avahi/trunk@312 941a03a8-eaeb-0310-b9a0-b1bbd8fe43fe

avahi-core/server.c
avahi-daemon/static-services.c
docs/TODO

index ae0b1e645b99a19c7f4518d92f855d7107add4f9..ca5da5d1161940cc06b3f94d5264efbdf9850a1f 100644 (file)
@@ -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);
index ff2602f91a698ec555ba7d8b747f801772253ce0..03824fde497b04511de758302a7ed47a3ee0bb07 100644 (file)
@@ -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;
index aeca215b6fe23fb41c456cdabc3ba07cf67e2084..4670224e4adb30ac36f18d2b5b0722e6334be30d 100644 (file)
--- 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