Brett 2023-10-27 15:45:03 -04:00
parent 229e605c15
commit a55c87e016
2 changed files with 5 additions and 4 deletions

View File

@ -37,8 +37,8 @@ if(CMAKE_THREAD_LIBS_INIT)
endif()
target_compile_options(insane_dns PRIVATE -Wall -Werror -Wpedantic -Wno-comment -Wno-format)
target_link_options(insane_dns PRIVATE -Wall -Werror -Wpedantic -Wno-comment -Wno-format)
target_compile_options(insane_dns PRIVATE -Wall -Werror -Wpedantic -Werror=return-local-addr -Wno-comment -Wno-format)
target_link_options(insane_dns PRIVATE -Wall -Werror -Wpedantic -Werror=return-local-addr -Wno-comment -Wno-format)
if (${ENABLE_ADDRSAN} MATCHES ON)
target_compile_options(${PROJECT_NAME} PRIVATE -fsanitize=address)

View File

@ -35,7 +35,7 @@ static constexpr unsigned short int SERVER_PORT = 5555;
*/
static BLT_CPP20_CONSTEXPR bind_address address() {
return {SERVER_PORT};
};
}
/** should we strictly match results? ie block `*wikipedia.org*` or just `wikipedia.org`? */
static constexpr bool STRICT_MATCHING = false;
@ -352,7 +352,8 @@ request_info handle_forward_request(MESSENGER messenger, const INFO& info, const
// forward to google.
size_t out_bytes;
messenger(DNS_SERVER_IP(), input_recv_buffer.data(), bytes, forward_recv_buffer, out_bytes);
const auto* data = input_recv_buffer.data();
messenger(DNS_SERVER_IP(), data, bytes, forward_recv_buffer, out_bytes);
uint16_t num_of_answers;
blt::mem::fromBytes(&forward_recv_buffer[info.ANSWERS_BEGIN], num_of_answers);