lmao, wiznet
This commit is contained in:
@@ -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++)
|
for (i = 0; i < pdhdr->qdcount; i++)
|
||||||
{
|
{
|
||||||
cp = dns_question(msg, cp);
|
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");
|
printf("MAX_DOMAIN_NAME is too small, it should be redfine in dns.h");
|
||||||
#endif
|
#endif
|
||||||
if(!cp) return -1;
|
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++)
|
for (i = 0; i < pdhdr->ancount; i++)
|
||||||
{
|
{
|
||||||
cp = dns_answer(msg, cp, ip_from_dns);
|
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");
|
printf("MAX_DOMAIN_NAME is too small, it should be redfine in dns.h");
|
||||||
#endif
|
#endif
|
||||||
if(!cp) return -1;
|
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
|
// Ensuring name fits into sname
|
||||||
if (strlen(name) >= MAXCNAME) {
|
if (strlen(name) >= MAXCNAME) {
|
||||||
// Handle error - name too long
|
// Handle error - name too long
|
||||||
|
#ifdef _DNS_DEBUG_
|
||||||
printf("Error: Name too long.\n");
|
printf("Error: Name too long.\n");
|
||||||
|
#endif
|
||||||
return -1;
|
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
|
// Ensures dlen is still valid
|
||||||
if (dlen <= 0) {
|
if (dlen <= 0) {
|
||||||
|
#ifdef _DNS_DEBUG_
|
||||||
printf("Error: dlen is non-positive.\n");
|
printf("Error: dlen is non-positive.\n");
|
||||||
|
#endif
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -60,7 +60,7 @@ extern "C" {
|
|||||||
* @brief Define it for Debug & Monitor DNS processing.
|
* @brief Define it for Debug & Monitor DNS processing.
|
||||||
* @note If defined, it dependens on <stdio.h>
|
* @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. */
|
#define MAX_DNS_BUF_SIZE 256 ///< maximum size of DNS buffer. */
|
||||||
/*
|
/*
|
||||||
|
|||||||
Reference in New Issue
Block a user