]> git.meshlink.io Git - catta/blobdiff - avahi-daemon/main.c
* added a status check
[catta] / avahi-daemon / main.c
index 12af74c32ef5615ce6aa25364c7f98e15380f0e7..83272009a042463d8e8f9d8587ab17e340a5bf9c 100644 (file)
@@ -75,6 +75,7 @@
 AvahiServer *avahi_server = NULL;
 AvahiSimplePoll *simple_poll_api = NULL;
 static char *argv0 = NULL;
+int nss_support = 0;
 
 typedef enum {
     DAEMON_RUN,
@@ -487,10 +488,6 @@ static int load_config_file(DaemonConfig *c) {
                     c->server_config.use_iff_running = is_yes(p->value);
                 else if (strcasecmp(p->key, "disallow-other-stacks") == 0)
                     c->server_config.disallow_other_stacks = is_yes(p->value);
-                else if (strcasecmp(p->key, "disable-publishing") == 0)
-                    c->server_config.disable_publishing = is_yes(p->value);
-                else if (strcasecmp(p->key, "disable-user-service-publishing") == 0)
-                    c->disable_user_service_publishing = is_yes(p->value);
 #ifdef HAVE_DBUS
                 else if (strcasecmp(p->key, "enable-dbus") == 0) {
 
@@ -526,6 +523,10 @@ static int load_config_file(DaemonConfig *c) {
                     c->server_config.publish_domain = is_yes(p->value);
                 else if (strcasecmp(p->key, "publish-resolv-conf-dns-servers") == 0)
                     c->publish_resolv_conf = is_yes(p->value);
+                else if (strcasecmp(p->key, "disable-publishing") == 0)
+                    c->server_config.disable_publishing = is_yes(p->value);
+                else if (strcasecmp(p->key, "disable-user-service-publishing") == 0)
+                    c->disable_user_service_publishing = is_yes(p->value);
                 else if (strcasecmp(p->key, "add-service-cookie") == 0)
                     c->server_config.add_service_cookie = is_yes(p->value);
                 else if (strcasecmp(p->key, "publish-dns-servers") == 0) {
@@ -697,6 +698,8 @@ static void signal_callback(AvahiWatch *watch, AVAHI_GCC_UNUSED int fd, AVAHI_GC
     }
 }
 
+/* Imported from ../avahi-client/nss-check.c */
+int avahi_nss_support(void);
 
 static int run_server(DaemonConfig *c) {
     int r = -1;
@@ -707,6 +710,9 @@ static int run_server(DaemonConfig *c) {
 
     assert(c);
 
+    if (!(nss_support = avahi_nss_support()))
+        avahi_log_warn("WARNING: No NSS support for mDNS detected, consider installing nss-mdns!");
+
     if (!(simple_poll_api = avahi_simple_poll_new())) {
         avahi_log_error("Failed to create main loop object.");
         goto finish;