Turn off mdnsresponder debugging by default

Currently mdnsresponder outputs debug info by default. Make this
optional by defining:

#define MDNS_RESPONDER_DEBUGGING=1
This commit is contained in:
Joost Nieuwenhuijse 2018-06-08 22:09:15 +02:00
parent a16997dee1
commit fdd3b6e20c
2 changed files with 11 additions and 0 deletions

View file

@ -38,9 +38,11 @@
#error "LWIP_IGMP needs to be defined in lwipopts.h"
#endif
#if MDNS_RESPONDER_DEBUGGING
#define qDebugLog // Log activity generally
#define qLogIncoming // Log all arriving multicast packets
#define qLogAllTraffic // Log and decode all mDNS packets
#endif
//-------------------------------------------------------------------
@ -776,9 +778,13 @@ static void mdns_recv(void *arg, struct udp_pcb *pcb, struct pbuf *p, const ip_a
// Sanity checks on size
if (plen > MDNS_RESPONDER_REPLY_SIZE) {
#ifdef qDebugLog
printf(">>> mdns_recv: pbuf too big\n");
#endif
} else if (plen < (SIZEOF_DNS_HDR + SIZEOF_DNS_QUERY + 1 + SIZEOF_DNS_ANSWER + 1)) {
#ifdef qDebugLog
printf(">>> mdns_recv: pbuf too small\n");
#endif
} else {
mdns_payload = malloc(plen);
if (!mdns_payload) {

View file

@ -21,6 +21,11 @@
#define MDNS_RESPONDER_REPLY_SIZE 320
#endif
#ifndef MDNS_RESPONDER_DEBUGGING
#define MDNS_RESPONDER_DEBUGGING 0
#endif
// Starts the mDNS responder task, call first
void mdns_init();