Add extra debugging output

Signed-off-by: DL6ER <dl6er@dl6er.de>
This commit is contained in:
DL6ER 2023-05-04 07:21:34 +02:00
parent 49bc744846
commit 7871ebe32b
No known key found for this signature in database
GPG Key ID: 00135ACBD90B28DD
3 changed files with 7 additions and 10 deletions

View File

@ -837,9 +837,6 @@ static char *parse_FTLconf(FILE *fp, const char *key)
// Go to beginning of file
fseek(fp, 0L, SEEK_SET);
if(config.debug & DEBUG_EXTRA)
logg("initial: conflinebuffer = %p, keystr = %p, size = %zu", conflinebuffer, keystr, size);
// Set size to zero if conflinebuffer is not available here
// This causes getline() to allocate memory for the buffer itself
if(conflinebuffer == NULL && size != 0)
@ -848,11 +845,6 @@ static char *parse_FTLconf(FILE *fp, const char *key)
errno = 0;
while(getline(&conflinebuffer, &size, fp) != -1)
{
if(config.debug & DEBUG_EXTRA)
{
logg("conflinebuffer = %p, keystr = %p, size = %zu", conflinebuffer, keystr, size);
logg(" while reading line \"%s\" looking for \"%s\"", conflinebuffer, keystr);
}
// Check if memory allocation failed
if(conflinebuffer == NULL)
break;

View File

@ -2089,7 +2089,7 @@ static int tcp_key_recurse(time_t now, int status, struct dns_header *header, si
unsigned char *packet = NULL;
struct dns_header *new_header = NULL;
FTL_header_analysis(header->hb4, 0, server, daemon->log_display_id);
FTL_header_analysis(header->hb4, RCODE(header), server, daemon->log_display_id);
while (1)
{

View File

@ -2614,7 +2614,12 @@ void _FTL_header_analysis(const unsigned char header4, const unsigned int rcode,
{
memcpy(&last_server, &server->addr, sizeof(last_server));
if(config.debug & DEBUG_EXTRA)
logg("Got forward address: YES");
{
char ip[ADDRSTRLEN+1] = { 0 };
in_port_t port = 0;
mysockaddr_extract_ip_port(&last_server, ip, &port);
logg("Got forward address: %s#%u (%s:%i)", ip, port, short_path(file), line);
}
}
else
{