From cf12608cf3927f75f6ec3fd41deec27a5b838578 Mon Sep 17 00:00:00 2001 From: Shreyas Zare Date: Sun, 16 Jun 2019 14:27:07 +0530 Subject: [PATCH] DhcpServer: fixed minor bug in RenameScope(). Added SaveScope() method. --- DnsServerCore/Dhcp/DhcpServer.cs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/DnsServerCore/Dhcp/DhcpServer.cs b/DnsServerCore/Dhcp/DhcpServer.cs index 1b13dc80..7ce2ad74 100644 --- a/DnsServerCore/Dhcp/DhcpServer.cs +++ b/DnsServerCore/Dhcp/DhcpServer.cs @@ -989,7 +989,7 @@ namespace DnsServerCore.Dhcp public void RenameScope(string name, string newName) { - if (_scopes.TryGetValue(name, out Scope scope)) + if (!_scopes.TryGetValue(name, out Scope scope)) throw new DhcpServerException("Scope with name '" + name + "' does not exists."); if (!_scopes.TryAdd(newName, scope)) @@ -1032,6 +1032,12 @@ namespace DnsServerCore.Dhcp } } + public void SaveScope(string name) + { + if (_scopes.TryGetValue(name, out Scope scope)) + SaveScopeFile(scope); + } + public IDictionary GetAddressClientMap() { Dictionary map = new Dictionary();