f7e6d39
From 1e14daab904b4c74e1ee4edd081d42478aa5d12a Mon Sep 17 00:00:00 2001
f7e6d39
From: Lennart Poettering <lennart@poettering.net>
f7e6d39
Date: Thu, 11 Dec 2008 20:11:42 +0100
f7e6d39
Subject: [PATCH] Include host in invalid packet messages
f7e6d39
f7e6d39
Include the source host in warning messages about invalid packets.
f7e6d39
f7e6d39
This is a result of rhbz #438013
f7e6d39
---
f7e6d39
 avahi-core/server.c |   12 ++++++++----
f7e6d39
 1 files changed, 8 insertions(+), 4 deletions(-)
f7e6d39
f7e6d39
diff --git a/avahi-core/server.c b/avahi-core/server.c
f7e6d39
index 453db09..c4980af 100644
f7e6d39
--- a/avahi-core/server.c
f7e6d39
+++ b/avahi-core/server.c
f7e6d39
@@ -941,26 +941,30 @@ static void dispatch_packet(AvahiServer *s, AvahiDnsPacket *p, const AvahiAddres
f7e6d39
         handle_query_packet(s, p, i, src_address, port, legacy_unicast, from_local_iface);
f7e6d39
         
f7e6d39
     } else {
f7e6d39
+        char t[AVAHI_ADDRESS_STR_MAX];
f7e6d39
+
f7e6d39
         if (port != AVAHI_MDNS_PORT) {
f7e6d39
-            avahi_log_warn("Received response with invalid source port %u on interface '%s.%i'", port, i->hardware->name, i->protocol);
f7e6d39
+            avahi_log_warn("Received response from host %s with invalid source port %u on interface '%s.%i'", avahi_address_snprint(t, sizeof(t), src_address), port, i->hardware->name, i->protocol);
f7e6d39
             return;
f7e6d39
         }
f7e6d39
 
f7e6d39
         if (ttl != 255 && s->config.check_response_ttl) {
f7e6d39
-            avahi_log_warn("Received response with invalid TTL %u on interface '%s.%i'.", ttl, i->hardware->name, i->protocol);
f7e6d39
+            avahi_log_warn("Received response from host %s with invalid TTL %u on interface '%s.%i'.", avahi_address_snprint(t, sizeof(t), src_address), ttl, i->hardware->name, i->protocol);
f7e6d39
             return;
f7e6d39
         }
f7e6d39
 
f7e6d39
         if (!is_mdns_mcast_address(dst_address) &&
f7e6d39
             !avahi_interface_address_on_link(i, src_address)) {
f7e6d39
-            avahi_log_warn("Received non-local response on interface '%s.%i'.", i->hardware->name, i->protocol);
f7e6d39
+
f7e6d39
+            avahi_log_warn("Received non-local response from host %s on interface '%s.%i'.", avahi_address_snprint(t, sizeof(t), src_address), i->hardware->name, i->protocol);
f7e6d39
             return;
f7e6d39
         }
f7e6d39
         
f7e6d39
         if (avahi_dns_packet_get_field(p, AVAHI_DNS_FIELD_QDCOUNT) != 0 ||
f7e6d39
             avahi_dns_packet_get_field(p, AVAHI_DNS_FIELD_ANCOUNT) == 0 ||
f7e6d39
             avahi_dns_packet_get_field(p, AVAHI_DNS_FIELD_NSCOUNT) != 0) {
f7e6d39
-            avahi_log_warn("Invalid response packet.");
f7e6d39
+
f7e6d39
+            avahi_log_warn("Invalid response packet from host %s.", avahi_address_snprint(t, sizeof(t), src_address));
f7e6d39
             return;
f7e6d39
         }
f7e6d39
 
f7e6d39
-- 
f7e6d39
1.6.0.5
f7e6d39