char *t = avahi_record_to_string(record);
if (won)
- avahi_log_debug("Recieved conflicting probe [%s]. Local host won.", t);
+ avahi_log_debug("Received conflicting probe [%s]. Local host won.", t);
else if (lost) {
- avahi_log_debug("Recieved conflicting probe [%s]. Local host lost. Withdrawing.", t);
+ avahi_log_debug("Received conflicting probe [%s]. Local host lost. Withdrawing.", t);
withdraw_rrset(s, record->key);
}
/* Refresh */
t = avahi_record_to_string(record);
- avahi_log_debug("Recieved goodbye record for one of our records [%s]. Refreshing.", t);
+ avahi_log_debug("Received goodbye record for one of our records [%s]. Refreshing.", t);
avahi_server_prepare_matching_responses(s, i, e->record->key, 0);
valid = 0;
/* Refresh */
t = avahi_record_to_string(record);
- avahi_log_debug("Recieved record with bad TTL [%s]. Refreshing.", t);
+ avahi_log_debug("Received record with bad TTL [%s]. Refreshing.", t);
avahi_server_prepare_matching_responses(s, i, e->record->key, 0);
valid = 0;
t = avahi_record_to_string(record);
if (withdraw_immediately) {
- avahi_log_debug("Recieved conflicting record [%s] with local record to be. Withdrawing.", t);
+ avahi_log_debug("Received conflicting record [%s] with local record to be. Withdrawing.", t);
withdraw_rrset(s, record->key);
} else {
assert(conflicting_entry);
- avahi_log_debug("Recieved conflicting record [%s]. Resetting our record.", t);
+ avahi_log_debug("Received conflicting record [%s]. Resetting our record.", t);
avahi_entry_return_to_initial_state(s, conflicting_entry, i);
/* Local unique records are returned to probing
int unicast_response = 0;
if (!(key = avahi_dns_packet_consume_key(p, &unicast_response))) {
- avahi_log_warn(__FILE__": Packet too short or invalid while reading question key. (Maybe an UTF8 problem?)");
+ avahi_log_warn(__FILE__": Packet too short or invalid while reading question key. (Maybe a UTF-8 problem?)");
goto fail;
}
int unique = 0;
if (!(record = avahi_dns_packet_consume_record(p, &unique))) {
- avahi_log_warn(__FILE__": Packet too short or invalid while reading known answer record. (Maybe an UTF8 problem?)");
+ avahi_log_warn(__FILE__": Packet too short or invalid while reading known answer record. (Maybe a UTF-8 problem?)");
goto fail;
}
- if (handle_conflict(s, i, record, unique)) {
- avahi_response_scheduler_suppress(i->response_scheduler, record, a);
- avahi_record_list_drop(s->record_list, record);
- avahi_cache_stop_poof(i->cache, record, a);
- }
+ avahi_response_scheduler_suppress(i->response_scheduler, record, a);
+ avahi_record_list_drop(s->record_list, record);
+ avahi_cache_stop_poof(i->cache, record, a);
avahi_record_unref(record);
}
int unique = 0;
if (!(record = avahi_dns_packet_consume_record(p, &unique))) {
- avahi_log_warn(__FILE__": Packet too short or invalid while reading probe record. (Maybe an UTF8 problem?)");
+ avahi_log_warn(__FILE__": Packet too short or invalid while reading probe record. (Maybe a UTF-8 problem?)");
goto fail;
}
/* char *txt; */
if (!(record = avahi_dns_packet_consume_record(p, &cache_flush))) {
- avahi_log_warn(__FILE__": Packet too short or invalid while reading response record. (Maybe an UTF8 problem?)");
+ avahi_log_warn(__FILE__": Packet too short or invalid while reading response record. (Maybe a UTF-8 problem?)");
break;
}
if (!(i = avahi_interface_monitor_get_interface(s->monitor, iface, src_address->proto)) ||
!i->announcing) {
- avahi_log_warn("Recieved packet from invalid interface.");
+ avahi_log_warn("Received packet from invalid interface.");
return;
}
from_local_iface = originates_from_local_iface(s, iface, src_address, port);
if (avahi_dns_packet_check_valid_multicast(p) < 0) {
- avahi_log_warn("Recieved invalid packet.");
+ avahi_log_warn("Received invalid packet.");
return;
}
} else {
if (port != AVAHI_MDNS_PORT) {
- avahi_log_warn("Recieved repsonse with invalid source port %u on interface '%s.%i'", port, i->hardware->name, i->protocol);
+ avahi_log_warn("Received response with invalid source port %u on interface '%s.%i'", port, i->hardware->name, i->protocol);
return;
}
if (ttl != 255 && s->config.check_response_ttl) {
- avahi_log_warn("Recieved response with invalid TTL %u on interface '%s.%i'.", ttl, i->hardware->name, i->protocol);
+ avahi_log_warn("Received response with invalid TTL %u on interface '%s.%i'.", ttl, i->hardware->name, i->protocol);
return;
}
assert(p);
if (avahi_dns_packet_check_valid(p) < 0 || avahi_dns_packet_is_query(p)) {
- avahi_log_warn("Recieved invalid packet.");
+ avahi_log_warn("Received invalid packet.");
return;
}
if (!(slot = find_slot(s, avahi_dns_packet_get_field(p, AVAHI_DNS_FIELD_ID)))) {
- avahi_log_warn("Recieved legacy unicast response with unknown id");
+ avahi_log_warn("Received legacy unicast response with unknown id");
return;
}
}
static int valid_server_config(const AvahiServerConfig *sc) {
+ AvahiStringList *l;
+
+ assert(sc);
+ if (sc->n_wide_area_servers > AVAHI_WIDE_AREA_SERVERS_MAX)
+ return AVAHI_ERR_INVALID_CONFIG;
+
if (sc->host_name && !avahi_is_valid_host_name(sc->host_name))
return AVAHI_ERR_INVALID_HOST_NAME;
if (sc->domain_name && !avahi_is_valid_domain_name(sc->domain_name))
return AVAHI_ERR_INVALID_DOMAIN_NAME;
+ for (l = sc->browse_domains; l; l = l->next)
+ if (!avahi_is_valid_domain_name((char*) l->text))
+ return AVAHI_ERR_INVALID_DOMAIN_NAME;
+
return AVAHI_OK;
}
return &s->config;
}
+
+/** Set the browsing domains */
+int avahi_server_set_browse_domains(AvahiServer *s, AvahiStringList *domains) {
+ AvahiStringList *l;
+
+ assert(s);
+
+ for (l = s->config.browse_domains; l; l = l->next)
+ if (!avahi_is_valid_domain_name((char*) l->text))
+ return avahi_server_set_errno(s, AVAHI_ERR_INVALID_DOMAIN_NAME);
+
+ avahi_string_list_free(s->config.browse_domains);
+ s->config.browse_domains = avahi_string_list_copy(domains);
+
+ return AVAHI_OK;
+}