From abf0d60e6dd933273887c1600e0793eac2706438 Mon Sep 17 00:00:00 2001 From: Niklas Hofmann Date: Fri, 8 Aug 2014 10:20:31 +0200 Subject: [PATCH] publish_no_reverse configuration flag added --- avahi-core/core.h | 1 + avahi-core/iface.c | 2 +- avahi-core/server.c | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/avahi-core/core.h b/avahi-core/core.h index f50c612..f14dc84 100644 --- a/avahi-core/core.h +++ b/avahi-core/core.h @@ -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. */ diff --git a/avahi-core/iface.c b/avahi-core/iface.c index f3b09a0..60a4f49 100644 --- a/avahi-core/iface.c +++ b/avahi-core/iface.c @@ -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; diff --git a/avahi-core/server.c b/avahi-core/server.c index 69a1d02..b348269 100644 --- a/avahi-core/server.c +++ b/avahi-core/server.c @@ -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; -- 2.39.5