Closed PonchoPowers closed 4 years ago
I should add that I think it is firewall related, haven't been able to quite work out what is going on as of yet.
Firewall config usually do not block outbound packets. It seems to be something else. I would suggest that you run Wireshark with DHCP traffic filter and see how it goes.
I have got to the bottom of what is going on now.
Firstly, my apologies as it is my wrongdoing misconfiguring the DHCP server.
But as a result I'd like to make a suggestion anyway.
The option I enabled, causing me problems was the Reserved Leases > Allow Only Reserved Lease Allocations option.
This in turn causes the following code to be executed:
Lease offer = scope.GetOffer(request);
if (offer == null)
throw new DhcpServerException("DHCP Server failed to offer address: address unavailable due to address pool exhaustion.");
Following it through I get to:
if (_allowOnlyReservedLeases)
return null; //client does not have reserved address as per scope requirements
This in turn returns null
, causing the exception to be thrown.
The exception message makes sense now I know what is going on, but the message is factually incorrect.
I think the code should be changed to:
if (_allowOnlyReservedLeases)
throw new DhcpServerException("DHCP Server failed to offer address: only reserved leases can be offered.");
This way at least the message makes sense.
Either that or upon returning null
, the AllowOnlyReservedLeases
property could be checked, and instead of throwing the "address unavailable due to address pool exhaustion." message, you can then throw the "only reserved leases can be offered." message.
Further down the code:
if (existingOffer.Type == LeaseType.None)
return null; //dummy offer so another thread is handling offer; do nothing
also returns null, but this should not throw an exception as the comment suggests another thread is already handling the offer.
Thanks for the debugging. I will update the exception message.
Technitium DNS Server v4.1 is now available that fixes this issue.
If the firewall blocks either of the outgoing ports 67 or 68, this leads to address pool exhaustion, and a massive amount of the following errors being logged: