summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/io/config.c3
-rw-r--r--src/server/server.c11
2 files changed, 12 insertions, 2 deletions
diff --git a/src/io/config.c b/src/io/config.c
index bf9d96a..d6cb6c3 100644
--- a/src/io/config.c
+++ b/src/io/config.c
@@ -475,10 +475,11 @@ static void config_push_record(Record** buf, Record record, uint16_t* capacity,
bool load_config(const char* path, RecordMap* map) {
FILE* file = fopen(path, "r");
if (file == NULL) {
- ERROR("Failed to open file %s: %s", path, strerror(errno));
return false;
}
+ INFO("Using config file at path: %s", path);
+
line = 0;
record_map_init(map);
diff --git a/src/server/server.c b/src/server/server.c
index bcb070d..c02a645 100644
--- a/src/server/server.c
+++ b/src/server/server.c
@@ -21,7 +21,16 @@ void server_init(uint16_t port, Server* server) {
INFO("Server port set to %hu", port);
create_binding(UDP, port, &server->udp);
create_binding(TCP, port, &server->tcp);
- load_config("config", &map);
+
+ if (load_config("/etc/wrapper.conf", &map)) {
+ return;
+ }
+
+ if (load_config("config", &map)) {
+ return;
+ }
+
+ WARN("No dns config files were found");
}
struct DnsRequest {