From 96fbf7f13448c18e4b78322bd467e8dfbf2e9826 Mon Sep 17 00:00:00 2001 From: Eugene Bujak Date: Thu, 13 Dec 2018 13:17:41 +0300 Subject: [PATCH] Fix yaml marshalling panic. --- config.go | 4 ++-- dhcp.go | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/config.go b/config.go index 8566de68..6f01d023 100644 --- a/config.go +++ b/config.go @@ -52,7 +52,7 @@ var defaultDNS = []string{"tls://1.1.1.1", "tls://1.0.0.1"} // field ordering is important -- yaml fields will mirror ordering from here type dhcpState struct { - dhcpConfig + Config dhcpConfig Leases []dhcpLease } @@ -98,7 +98,7 @@ var config = configuration{ {Filter: dnsfilter.Filter{ID: 3}, Enabled: false, URL: "https://hosts-file.net/ad_servers.txt", Name: "hpHosts - Ad and Tracking servers only"}, {Filter: dnsfilter.Filter{ID: 4}, Enabled: false, URL: "http://www.malwaredomainlist.com/hostslist/hosts.txt", Name: "MalwareDomainList.com Hosts List"}, }, - DHCP: dhcpState{dhcpConfig: dhcpConfig{ + DHCP: dhcpState{Config: dhcpConfig{ LeaseDuration: time.Hour * 12, }}, SchemaVersion: currentSchemaVersion, diff --git a/dhcp.go b/dhcp.go index 5a6fc490..2cbc1cb6 100644 --- a/dhcp.go +++ b/dhcp.go @@ -8,7 +8,7 @@ import ( func handleDHCPStatus(w http.ResponseWriter, r *http.Request) { status := map[string]interface{}{ - "config": config.DHCP.dhcpConfig, + "config": config.DHCP.Config, "leases": config.DHCP.Leases, } @@ -28,7 +28,7 @@ func handleDHCPSetConfig(w http.ResponseWriter, r *http.Request) { return } - config.DHCP.dhcpConfig = newconfig + config.DHCP.Config = newconfig } // TODO: implement