]> granicus.if.org Git - esp-idf/commitdiff
dhcpserver: suppress send_nak debug output
authorzhangyanjiao <zhangyanjiao@espressif.com>
Thu, 14 Mar 2019 03:47:21 +0000 (11:47 +0800)
committerzhangyanjiao <zhangyanjiao@espressif.com>
Thu, 14 Mar 2019 06:00:35 +0000 (14:00 +0800)
Closes https://github.com/espressif/esp-idf/issues/2924

components/lwip/apps/dhcpserver/dhcpserver.c

index 5e0c1a6780bdec8e645f5d58ff5cea34ac60ea8a..df6a2af022c96d05e4a2afa52c53c3281f75e91a 100644 (file)
@@ -553,7 +553,9 @@ static void send_nak(struct dhcps_msg *m, u16_t len)
     u8_t *data;
     u16_t cnt = 0;
     u16_t i;
+#if DHCPS_DEBUG
     err_t SendNak_err_t;
+#endif
     create_msg(m);
 
     end = add_msg_type(&m->options[4], DHCPNAK);
@@ -600,8 +602,12 @@ static void send_nak(struct dhcps_msg *m, u16_t len)
 
     ip_addr_t ip_temp = IPADDR4_INIT(0x0);
     ip4_addr_set(ip_2_ip4(&ip_temp), &broadcast_dhcps);
+#if DHCPS_DEBUG
     SendNak_err_t = udp_sendto(pcb_dhcps, p, &ip_temp, DHCPS_CLIENT_PORT);
     DHCPS_LOG("dhcps: send_nak>>udp_sendto result %x\n", SendNak_err_t);
+#else
+    udp_sendto(pcb_dhcps, p, &ip_temp, DHCPS_CLIENT_PORT);
+#endif
 
     if (p->ref != 0) {
 #if DHCPS_DEBUG