]> git.meshlink.io Git - catta/commitdiff
be more specific in an error message when receiving packets
authorSven M. Hallberg <pesco@khjk.org>
Mon, 8 Sep 2014 16:21:39 +0000 (18:21 +0200)
committerSven M. Hallberg <pesco@khjk.org>
Mon, 8 Sep 2014 16:21:39 +0000 (18:21 +0200)
src/server.c

index 5a9e050b71c20f5d99413f4cff3165d212076feb..fffbfdfdad85506dce2979af0518e29809fc063a 100644 (file)
@@ -899,9 +899,12 @@ static void dispatch_packet(CattaServer *s, CattaDnsPacket *p, const CattaAddres
     assert(iface > 0);
     assert(src_address->proto == dst_address->proto);
 
-    if (!(i = catta_interface_monitor_get_interface(s->monitor, iface, src_address->proto)) ||
-        !i->announcing) {
-        catta_log_warn("Received packet from invalid interface.");
+    if (!(i = catta_interface_monitor_get_interface(s->monitor, iface, src_address->proto))) {
+        catta_log_warn("Received packet from unrecognized interface (%d).", iface);
+        return;
+    }
+    if (!i->announcing) {
+        catta_log_warn("Received packet from invalid interface %d (not announcing).", iface);
         return;
     }