]> git.meshlink.io Git - catta/commitdiff
publish_no_reverse configuration flag added
authorNiklas Hofmann <niklas.hofmann@everbase.net>
Fri, 8 Aug 2014 08:20:31 +0000 (10:20 +0200)
committerNiklas Hofmann <niklas.hofmann@everbase.net>
Fri, 8 Aug 2014 08:20:31 +0000 (10:20 +0200)
avahi-core/core.h
avahi-core/iface.c
avahi-core/server.c

index f50c6128ad69ee6c35cc73497d8bd5794006d0a6..f14dc849a2edcfc7f2597c5f70b79660311c6c95 100644 (file)
@@ -50,6 +50,7 @@ typedef struct AvahiServerConfig {
     AvahiStringList *deny_interfaces; /**< Deny specific interfaces to be used for Avahi */
     int publish_hinfo;                /**< Register a HINFO record for the host containing the local OS and CPU type */
     int publish_addresses;            /**< Register A, AAAA and PTR records for all local IP addresses */
+    int publish_no_reverse;           /**< Do not register PTR records */
     int publish_workstation;          /**< Register a _workstation._tcp service */
     int publish_domain;               /**< Announce the local domain for browsing */
     int check_response_ttl;           /**< If enabled the server ignores all incoming responses with IP TTL != 255. Newer versions of the RFC do no longer contain this check, so it is disabled by default. */
index f3b09a096c5f0557f5597cbb73a01645ccc86623..60a4f4939168df95c15a2d0ab21ad845843a2bb7 100644 (file)
@@ -73,7 +73,7 @@ void avahi_interface_address_update_rrs(AvahiInterfaceAddress *a, int remove_rrs
             avahi_address_snprint(t, sizeof(t), &a->address);
             avahi_log_info("Registering new address record for %s on %s.%s.", t, a->interface->hardware->name, p == AVAHI_PROTO_UNSPEC ? "*" : avahi_proto_to_string(p));
 
-            if (avahi_server_add_address(m->server, a->entry_group, a->interface->hardware->index, p, AVAHI_PUBLISH_NO_REVERSE, NULL, &a->address) < 0) {
+            if (avahi_server_add_address(m->server, a->entry_group, a->interface->hardware->index, p, m->server->config.publish_no_reverse ? AVAHI_PUBLISH_NO_REVERSE : 0, NULL, &a->address) < 0) {
                 avahi_log_warn(__FILE__": avahi_server_add_address() failed: %s", avahi_strerror(m->server->error));
                 avahi_s_entry_group_free(a->entry_group);
                 a->entry_group = NULL;
index 69a1d02bfdec3ac2c2647acd8a0aa185852c4ae1..b348269d59dd15544eace1b9c399f86b8fe67e9c 100644 (file)
@@ -1584,6 +1584,7 @@ AvahiServerConfig* avahi_server_config_init(AvahiServerConfig *c) {
     c->check_response_ttl = 0;
     c->publish_hinfo = 0;
     c->publish_addresses = 1;
+    c->publish_no_reverse = 0;
     c->publish_workstation = 0;
     c->publish_domain = 1;
     c->use_iff_running = 0;