lmao, wiznet

This commit is contained in:
2024-10-11 06:30:32 +06:00
parent 555abf9503
commit 0a6948ad59
2 changed files with 7 additions and 3 deletions

View File

@@ -367,7 +367,7 @@ int8_t parseDNSMSG(struct dhdr * pdhdr, uint8_t * pbuf, uint8_t * ip_from_dns)
for (i = 0; i < pdhdr->qdcount; i++)
{
cp = dns_question(msg, cp);
#ifdef _DNS_DEUBG_
#ifdef _DNS_DEBUG_
printf("MAX_DOMAIN_NAME is too small, it should be redfine in dns.h");
#endif
if(!cp) return -1;
@@ -377,7 +377,7 @@ int8_t parseDNSMSG(struct dhdr * pdhdr, uint8_t * pbuf, uint8_t * ip_from_dns)
for (i = 0; i < pdhdr->ancount; i++)
{
cp = dns_answer(msg, cp, ip_from_dns);
#ifdef _DNS_DEUBG_
#ifdef _DNS_DEBUG_
printf("MAX_DOMAIN_NAME is too small, it should be redfine in dns.h");
#endif
if(!cp) return -1;
@@ -422,7 +422,9 @@ int16_t dns_makequery(uint16_t op, char *name, uint8_t *buf, uint16_t len) {
// Ensuring name fits into sname
if (strlen(name) >= MAXCNAME) {
// Handle error - name too long
#ifdef _DNS_DEBUG_
printf("Error: Name too long.\n");
#endif
return -1;
}
@@ -459,7 +461,9 @@ int16_t dns_makequery(uint16_t op, char *name, uint8_t *buf, uint16_t len) {
// Ensures dlen is still valid
if (dlen <= 0) {
#ifdef _DNS_DEBUG_
printf("Error: dlen is non-positive.\n");
#endif
return -1;
}
}

View File

@@ -60,7 +60,7 @@ extern "C" {
* @brief Define it for Debug & Monitor DNS processing.
* @note If defined, it dependens on <stdio.h>
*/
#define _DNS_DEBUG_
// #define _DNS_DEBUG_
#define MAX_DNS_BUF_SIZE 256 ///< maximum size of DNS buffer. */
/*