From aebcd74efe5fedfcf4db7229d171471c26dd8a69 Mon Sep 17 00:00:00 2001 From: Ainar Garipov Date: Mon, 15 Feb 2021 14:20:23 +0300 Subject: [PATCH] Pull request: home: imp init Merge in DNS/adguard-home from fix-init to master Squashed commit of the following: commit 551c143f6c3846f061b3118a06e1c756bc3e2ba1 Author: Ainar Garipov Date: Mon Feb 15 13:45:06 2021 +0300 home: imp init --- CHANGELOG.md | 1 + internal/home/home.go | 10 +++++----- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 775ebcc8..f84a1b6a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -28,6 +28,7 @@ and this project adheres to ### Fixed +- Occasional crashes during startup. - The field `"range_start"` in the `GET /control/dhcp/status` HTTP API response is now correctly named again ([#2678]). - DHCPv6 server's `ra_slaac_only` and `ra_allow_slaac` settings aren't reset to diff --git a/internal/home/home.go b/internal/home/home.go index 1b6312c8..8db077ed 100644 --- a/internal/home/home.go +++ b/internal/home/home.go @@ -304,6 +304,11 @@ func run(args options) { log.Fatalf("Can't initialize Web module") } + Context.ipDetector, err = newIPDetector() + if err != nil { + log.Fatal(err) + } + if !Context.firstRun { err := initDNSServer() if err != nil { @@ -324,11 +329,6 @@ func run(args options) { } } - Context.ipDetector, err = newIPDetector() - if err != nil { - log.Fatal(err) - } - Context.web.Start() // wait indefinitely for other go-routines to complete their job