mirror of
https://github.com/pi-hole/dnsmasq.git
synced 2025-12-19 18:28:25 +00:00
dhcp-host selection fix for v4/v6.
Avoid treating a --dhcp-host which has an IPv6 address as eligable for use with DHCPv4 on the grounds that it has no address, and vice-versa.
This commit is contained in:
@@ -14,6 +14,12 @@ version 2.85
|
|||||||
sorts before v2.83test1. This fixes the problem which lead
|
sorts before v2.83test1. This fixes the problem which lead
|
||||||
to 2.84 announcing itself as 2.84rc2.
|
to 2.84 announcing itself as 2.84rc2.
|
||||||
|
|
||||||
|
Avoid treating a --dhcp-host which has an IPv6 address
|
||||||
|
as eligable for use with DHCPv4 on the grounds that it has
|
||||||
|
no address, and vice-versa. Thanks to Viktor Papp for
|
||||||
|
spotting the problem. (This bug was fixed was back in 2.67, and
|
||||||
|
then regessed in 2.81).
|
||||||
|
|
||||||
|
|
||||||
version 2.84
|
version 2.84
|
||||||
Fix a problem, introduced in 2.83, which could see DNS replies
|
Fix a problem, introduced in 2.83, which could see DNS replies
|
||||||
|
|||||||
@@ -281,14 +281,15 @@ static int is_config_in_context(struct dhcp_context *context, struct dhcp_config
|
|||||||
if (!context) /* called via find_config() from lease_update_from_configs() */
|
if (!context) /* called via find_config() from lease_update_from_configs() */
|
||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
|
if (!(config->flags & (CONFIG_ADDR | CONFIG_ADDR6)))
|
||||||
|
return 1;
|
||||||
|
|
||||||
#ifdef HAVE_DHCP6
|
#ifdef HAVE_DHCP6
|
||||||
if (context->flags & CONTEXT_V6)
|
if (context->flags & CONTEXT_V6)
|
||||||
{
|
{
|
||||||
struct addrlist *addr_list;
|
struct addrlist *addr_list;
|
||||||
|
|
||||||
if (!(config->flags & CONFIG_ADDR6))
|
if (config->flags & CONFIG_ADDR6)
|
||||||
return 1;
|
|
||||||
|
|
||||||
for (; context; context = context->current)
|
for (; context; context = context->current)
|
||||||
for (addr_list = config->addr6; addr_list; addr_list = addr_list->next)
|
for (addr_list = config->addr6; addr_list; addr_list = addr_list->next)
|
||||||
{
|
{
|
||||||
@@ -302,9 +303,6 @@ static int is_config_in_context(struct dhcp_context *context, struct dhcp_config
|
|||||||
else
|
else
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
if (!(config->flags & CONFIG_ADDR))
|
|
||||||
return 1;
|
|
||||||
|
|
||||||
for (; context; context = context->current)
|
for (; context; context = context->current)
|
||||||
if ((config->flags & CONFIG_ADDR) && is_same_net(config->addr, context->start, context->netmask))
|
if ((config->flags & CONFIG_ADDR) && is_same_net(config->addr, context->start, context->netmask))
|
||||||
return 1;
|
return 1;
|
||||||
|
|||||||
Reference in New Issue
Block a user