[Chilli] MAC Flapping bug in dhcp_nakDNS

Andre Beck beck at ibh.de
Sat Nov 14 16:17:39 UTC 2009


Hi,

I'm seeing a steady stream of MAC flap warnings on switches operating
a Coova Chilli installation, where the MAC of a client appears to
flap between the client side (coming from Cisco WLCs here, but that's
not relevant) and the port towards the server running the Chilli
instance in question. I think I tracked it down to this fix:

--- src/dhcp.c.orig     2009-11-14 17:04:01.000000000 +0100
+++ src/dhcp.c  2009-11-14 17:04:29.000000000 +0100
@@ -786,7 +786,7 @@
 
   memcpy(answer, pack, len); 
 
-  answer_ethh = ethhdr(pack);
+  answer_ethh = ethhdr(answer);
   answer_iph  = iphdr(answer);
   answer_udph = udphdr(answer);
   answer_dns  = dnspkt(answer);


Apparently, the intented swapping of the Ethernet SA and DA is done
on the wrong buffer (the original packet, not the answer copy that
will get sent), so it's missing from the final frame going out.

Please note that this will mean dhcp_nakDNS() has never worked as
expected, so fixing it now might introduce a regression. I'm entirely
not sure sending NXdomains to clients for potentially perfectly valid
queries is that good an idea, especially in times of resolver-side
negative caching. But that's another story, first I'd like to get rid
of the noise in my switch logs ;)

HTH,
Andre.
-- 
                    Cool .signatures are so 90s...

-> Andre Beck    +++ ABP-RIPE +++      IBH IT-Service GmbH, Dresden <-


More information about the Chilli mailing list