]> arthur.barton.de Git - netatalk.git/commitdiff
Use the right servername for zeroconf
authorFrank Lahm <franklahm@googlemail.com>
Sun, 20 Jun 2010 11:13:06 +0000 (13:13 +0200)
committerFrank Lahm <franklahm@googlemail.com>
Sun, 20 Jun 2010 11:13:06 +0000 (13:13 +0200)
etc/afpd/afp_config.c

index d53dee14d4f637165c98c8804593596e453ca375..f69c74a854ba58dc81a76c75e7c55cc4fbb9706b 100644 (file)
@@ -465,30 +465,10 @@ srvloc_reg_err:
 #endif /* USE_SRVLOC */
 
 #ifdef USE_ZEROCONF
-    uint afp_port;
-    const char *hostname = NULL;
-
     dsi->zeroconf_registered = 0; /*  Mark that we haven't registered.  */
-
     if (!(options->flags & OPTION_NOZEROCONF)) {
-        /* XXX We don't want to tack on the port number if we don't have to.
-          * Why?
-          * Well, this seems to break MacOS < 10.  If the user _really_ wants to
-          * use a non-default port, they can, but be aware, this server might
-          * not show up int the Network Browser.
-          */
-        afp_port = getip_port((struct sockaddr *)&dsi->server);
-
-        /* If specified use the FQDN to register with srvloc, otherwise use IP. */
-        p = NULL;
-        if (options->fqdn) {
-            hostname = options->fqdn;
-            p = strchr(hostname, ':');
-        }  else {
-            hostname = getip_string((struct sockaddr *)&dsi->server);
-        }
-
-        zeroconf_register(afp_port, hostname);
+        zeroconf_register(getip_port((struct sockaddr *)&dsi->server),
+                          options->server ? options->server : options->hostname);
         dsi->zeroconf_registered = 1; /*  Mark that we have registered.  */
         config->server_cleanup = dsi_cleanup;
     }