dinoco

Query DNS records
git clone git://git.relim.de/dinoco.git
Log | Files | Refs | README | LICENSE

commit 2589aef0eedb0c9a937b93ce6af68ee294bd1ad7
parent 5bd5ba0e5cd9c9be541fee44464e4da60ab975a5
Author: Nibo <kroekerrobin@gmail.com>
Date:   Wed, 21 Jun 2023 13:14:33 +0200

Set MAX_UDP_MSG_LENGTH

Diffstat:
Mdinoco.c | 4++--
Mdinoco.h | 1+
2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/dinoco.c b/dinoco.c @@ -411,8 +411,8 @@ struct byte_array *reqServer(char *req, int length) size_t bytesSent = sendto(fd, req, length, 0, (struct sockaddr *) &addr, size); if (bytesSent == length) { - char *res = malloc(200 * sizeof(char)); - size_t bytesReceived = recvfrom(fd, res, 200, 0, (struct sockaddr *) &addr, &size); + char *res = malloc(MAX_UDP_MSG_LENGTH * sizeof(char)); + size_t bytesReceived = recvfrom(fd, res, MAX_UDP_MSG_LENGTH, 0, (struct sockaddr *) &addr, &size); if (bytesReceived > 0) { struct byte_array *response = malloc(sizeof(struct byte_array)); diff --git a/dinoco.h b/dinoco.h @@ -1,3 +1,4 @@ +#define MAX_UDP_MSG_LENGTH 512 #define DNS_HEADER_LENGTH 12 #define MIN_IP_LENGTH 7