DhcpServer: fixed minor bug in RenameScope(). Added SaveScope() method.

This commit is contained in:
Shreyas Zare
2019-06-16 14:27:07 +05:30
parent 39dd66f44b
commit cf12608cf3

View File

@@ -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<string, string> GetAddressClientMap()
{
Dictionary<string, string> map = new Dictionary<string, string>();