diff --git a/libc/netdb/lib_dnsquery.c b/libc/netdb/lib_dnsquery.c index 59196206b6..073ff7ee13 100644 --- a/libc/netdb/lib_dnsquery.c +++ b/libc/netdb/lib_dnsquery.c @@ -64,9 +64,14 @@ #define MAX_RETRIES 8 -/* Buffer sizes */ +/* Buffer sizes + * + * The SEND_BUFFER_SIZE depends the configured DNS name size, + * sizeof(DNS query0 = Header (12 bytes) + DNS Name (Variable) + + * Query type (2 bytes) + Query Class (2 bytes) + */ -#define SEND_BUFFER_SIZE 64 +#define SEND_BUFFER_SIZE (32 + CONFIG_NETDB_DNSCLIENT_NAMESIZE) #define RECV_BUFFER_SIZE CONFIG_NETDB_DNSCLIENT_MAXRESPONSE /****************************************************************************