Required FTL changes due to the preceding dnsmasq commit.

Signed-off-by: DL6ER <dl6er@dl6er.de>
This commit is contained in:
DL6ER
2021-09-12 16:15:33 +02:00
parent b1e0486849
commit 0afc7ca910
6 changed files with 48 additions and 23 deletions
+15 -4
View File
@@ -41,6 +41,9 @@
// get_edestr()
#include "api_helper.h"
// defined in src/dnsmasq/cache.c
extern char *querystr(char *desc, unsigned short type);
#define min(a,b) ({ __typeof__ (a) _a = (a); __typeof__ (b) _b = (b); _a < _b ? _a : _b; })
/* qsort comparision function (count field), sort ASC */
@@ -881,10 +884,18 @@ void getAllQueries(const char *client_message, const int *sock)
char othertype[12] = { 0 }; // Maximum is "TYPE65535" = 10 bytes
if(query->type == TYPE_OTHER)
{
// Format custom type into buffer
sprintf(othertype, "TYPE%u", query->qtype);
// Replace qtype pointer
qtype = othertype;
// Check the dnsmasq RR types table for a matching record
qtype = querystr((char*)"", query->qtype);
logg("Typestr: %s", qtype);
// If not known (querystr() returned "type=1234"), we replace this
if(!qtype || strstr(qtype, "type=") != NULL)
{
// Format custom type into buffer
sprintf(othertype, "TYPE%u", query->qtype);
// Replace qtype pointer
qtype = othertype;
}
}
// Hide UNKNOWN queries when not requesting both query status types