summaryrefslogtreecommitdiff
path: root/src/packet/packet.c
diff options
context:
space:
mode:
authorTyler Murphy <tylerm@tylerm.dev>2023-04-12 14:24:39 -0400
committerTyler Murphy <tylerm@tylerm.dev>2023-04-12 14:24:39 -0400
commit1aeff9e8a41318cbdb223774f525094e355546c1 (patch)
treed6ecfe82ec6f0d7916ca84f1cabda23dadb687bf /src/packet/packet.c
parentmakefile install and uninstall, use different config path (diff)
downloadwrapper-1aeff9e8a41318cbdb223774f525094e355546c1.tar.gz
wrapper-1aeff9e8a41318cbdb223774f525094e355546c1.tar.bz2
wrapper-1aeff9e8a41318cbdb223774f525094e355546c1.zip
dumb bug
Diffstat (limited to 'src/packet/packet.c')
-rw-r--r--src/packet/packet.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/packet/packet.c b/src/packet/packet.c
index 07bfccc..cdd4191 100644
--- a/src/packet/packet.c
+++ b/src/packet/packet.c
@@ -8,6 +8,7 @@
#include "header.h"
#include "question.h"
#include "record.h"
+#include "../io/log.h"
void read_packet(PacketBuffer* buffer, Packet* packet) {
read_header(buffer, &packet->header);
@@ -16,6 +17,7 @@ void read_packet(PacketBuffer* buffer, Packet* packet) {
for(uint16_t i = 0; i < packet->header.questions; i++) {
if (!read_question(buffer, &packet->questions[i])) {
i--;
+ WARN("J");
packet->header.questions--;
}
}
@@ -24,24 +26,25 @@ void read_packet(PacketBuffer* buffer, Packet* packet) {
for(uint16_t i = 0; i < packet->header.answers; i++) {
if (!read_record(buffer, &packet->answers[i])) {
i--;
+ WARN("A");
packet->header.answers--;
}
}
packet->authorities = malloc(sizeof(Record) * packet->header.authoritative_entries);
for(uint16_t i = 0; i < packet->header.authoritative_entries; i++) {
- read_record(buffer, &packet->authorities[i]);
if (!read_record(buffer, &packet->authorities[i])) {
i--;
+ WARN("B");
packet->header.authoritative_entries--;
}
}
packet->resources = malloc(sizeof(Record) * packet->header.resource_entries);
for(uint16_t i = 0; i < packet->header.resource_entries; i++) {
- read_record(buffer, &packet->resources[i]);
if (!read_record(buffer, &packet->resources[i])) {
i--;
+ WARN("C");
packet->header.resource_entries--;
}
}