From e4cdbbf5218f6fa6d7b2b172091ddb0aa9ad3bfe Mon Sep 17 00:00:00 2001 From: Vladislav Grishenko Date: Mon, 19 Aug 2013 16:20:31 +0100 Subject: [PATCH] Allow prefix :: in constructed dhcp-range. --- man/dnsmasq.8 | 8 ++++++++ src/dhcp6.c | 4 +++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/man/dnsmasq.8 b/man/dnsmasq.8 index e843885..4357d99 100644 --- a/man/dnsmasq.8 +++ b/man/dnsmasq.8 @@ -663,6 +663,14 @@ equal either the start or end address given in the dhcp-range. This is to prevent prefixes becoming perpetual if the interface gains a SLAAC address for the prefix when it is advertised by dnsmasq. +If a dhcp-range is only being used for stateless DHCP and/or SLAAC, +then the address can be simply :: + +.B --dhcp-range=::,constructor:eth0 + +This removes the condition above, and will pick up the prefix from any address on eth0 which is NOT +autoconfigured, slaac, temporary or deprecated. + There is a variant of the constructor: syntax using the keyword .B constructor-noauth. See diff --git a/src/dhcp6.c b/src/dhcp6.c index 89af7dd..3bb855f 100644 --- a/src/dhcp6.c +++ b/src/dhcp6.c @@ -539,7 +539,9 @@ static int construct_worker(struct in6_addr *local, int prefix, } else if ((addr6part(local) == addr6part(&template->start6) || - addr6part(local) == addr6part(&template->end6)) && + addr6part(local) == addr6part(&template->end6) || + (IN6_IS_ADDR_UNSPECIFIED(&template->start6) && + IFACE_PERMANENT == (flags & (IFACE_PERMANENT | IFACE_DEPRECATED)))) && wildcard_match(template->template_interface, ifrn_name)) { start6 = *local;