static void reflect_response(AvahiServer *s, AvahiInterface *i, AvahiRecord *r, int flush_cache) {
AvahiInterface *j;
static void reflect_response(AvahiServer *s, AvahiInterface *i, AvahiRecord *r, int flush_cache) {
AvahiInterface *j;
assert(avahi_record_list_is_empty(s->record_list));
is_probe = avahi_dns_packet_get_field(p, AVAHI_DNS_FIELD_NSCOUNT) > 0;
assert(avahi_record_list_is_empty(s->record_list));
is_probe = avahi_dns_packet_get_field(p, AVAHI_DNS_FIELD_NSCOUNT) > 0;
for (n = avahi_dns_packet_get_field(p, AVAHI_DNS_FIELD_ANCOUNT) +
avahi_dns_packet_get_field(p, AVAHI_DNS_FIELD_ARCOUNT); n > 0; n--) {
AvahiRecord *record;
for (n = avahi_dns_packet_get_field(p, AVAHI_DNS_FIELD_ANCOUNT) +
avahi_dns_packet_get_field(p, AVAHI_DNS_FIELD_ARCOUNT); n > 0; n--) {
AvahiRecord *record;
if (handle_conflict(s, i, record, cache_flush)) {
if (!from_local_iface)
reflect_response(s, i, record, cache_flush);
if (handle_conflict(s, i, record, cache_flush)) {
if (!from_local_iface)
reflect_response(s, i, record, cache_flush);
/* Reflecting legacy unicast queries is a little more complicated
than reflecting normal queries, since we must route the
responses back to the right client. Therefore we must store
/* Reflecting legacy unicast queries is a little more complicated
than reflecting normal queries, since we must route the
responses back to the right client. Therefore we must store
if (avahi_address_is_ipv4_in_ipv6(src_address))
/* This is an IPv4 address encapsulated in IPv6, so let's ignore it. */
return;
if (avahi_address_is_ipv4_in_ipv6(src_address))
/* This is an IPv4 address encapsulated in IPv6, so let's ignore it. */
return;
handle_query_packet(s, p, i, src_address, port, legacy_unicast, from_local_iface);
handle_query_packet(s, p, i, src_address, port, legacy_unicast, from_local_iface);
} 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);
} 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);
}
handle_response_packet(s, p, i, src_address, from_local_iface);
}
handle_response_packet(s, p, i, src_address, from_local_iface);
if (s->browse_domain_entry_group)
assert(avahi_s_entry_group_is_empty(s->browse_domain_entry_group));
else
if (s->browse_domain_entry_group)
assert(avahi_s_entry_group_is_empty(s->browse_domain_entry_group));
else