mirror of
https://github.com/fergalmoran/DnsServer.git
synced 2026-02-21 15:25:54 +00:00
DhcpServer: changed sequence of FindThisDnsServerAddress() call in ActivateScopeAsync() after the FindInterface() so that the DNS address is correctly read.
This commit is contained in:
@@ -795,10 +795,6 @@ namespace DnsServerCore.Dhcp
|
||||
|
||||
try
|
||||
{
|
||||
//find this dns server address in case the network config has changed
|
||||
if (scope.UseThisDnsServer)
|
||||
scope.FindThisDnsServerAddress();
|
||||
|
||||
//find scope interface for binding socket
|
||||
if (waitForInterface)
|
||||
{
|
||||
@@ -821,6 +817,10 @@ namespace DnsServerCore.Dhcp
|
||||
throw new DhcpServerException("DHCP Server requires static IP address to work correctly but no network interface was found to have any static IP address configured.");
|
||||
}
|
||||
|
||||
//find this dns server address in case the network config has changed
|
||||
if (scope.UseThisDnsServer)
|
||||
scope.FindThisDnsServerAddress();
|
||||
|
||||
IPAddress interfaceAddress = scope.InterfaceAddress;
|
||||
dhcpEP = new IPEndPoint(interfaceAddress, 67);
|
||||
|
||||
|
||||
@@ -448,7 +448,7 @@ namespace DnsServerCore.Dhcp
|
||||
{
|
||||
NetworkInterface[] networkInterfaces = NetworkInterface.GetAllNetworkInterfaces();
|
||||
|
||||
//find interface in current scope range
|
||||
//find interface in current scope network range
|
||||
uint networkAddressNumber = _networkAddress.ConvertIpToNumber();
|
||||
uint subnetMaskNumber = _subnetMask.ConvertIpToNumber();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user