Blame SOURCES/dnsmasq-2.66-Allow-constructed-ranges-from-interface-address-at-end-of-range.patch

cab8d5
From 429805dbbc3888abc0d472c45935e92057964384 Mon Sep 17 00:00:00 2001
cab8d5
From: Simon Kelley <simon@thekelleys.org.uk>
cab8d5
Date: Fri, 31 May 2013 13:47:26 +0100
cab8d5
Subject: [PATCH 1/1] Allow constructed ranges from interface address at end of range.
cab8d5
cab8d5
Also make man page on this clearer, as it's been confusing many.
cab8d5
---
cab8d5
 man/dnsmasq.8 |   11 ++++++++++-
cab8d5
 src/dhcp6.c   |    4 +++-
cab8d5
 2 files changed, 13 insertions(+), 2 deletions(-)
cab8d5
cab8d5
diff --git a/man/dnsmasq.8 b/man/dnsmasq.8
cab8d5
index d2e3d18..1c3dfeb 100644
cab8d5
--- a/man/dnsmasq.8
cab8d5
+++ b/man/dnsmasq.8
cab8d5
@@ -649,7 +649,16 @@ This forms a template which describes how to create ranges, based on the address
cab8d5
 
cab8d5
 .B --dhcp-range=::1,::400,constructor:eth0
cab8d5
 
cab8d5
-will look for addresses of the form <network>::1 on eth0 and then create a range from <network>::1 to <network>::400. If the interface is assigned more than one network, then the corresponding ranges will be automatically created, and then deprecated and finally removed again as the address is deprecated and then deleted. The interface name may have a final "*" wildcard.
cab8d5
+will look for addresses of the form <network>::1 or <network>:400 on
cab8d5
+eth0 and then create a range from <network>::1 to <network>::400. If
cab8d5
+the interface is assigned more than one network, then the
cab8d5
+corresponding ranges will be automatically created, and then
cab8d5
+deprecated and finally removed again as the address is deprecated and
cab8d5
+then deleted. The interface name may have a final "*" wildcard. Note
cab8d5
+that just any address on eth0 will not do: the non-prefix part must be
cab8d5
+equal either the start or end address given in the dhcp-range. This is
cab8d5
+to prevent prefixes becoming perpetual if the interface 
cab8d5
+gains a SLAAC address for the prefix when it is advertised by dnsmasq.
cab8d5
 
cab8d5
 The optional 
cab8d5
 .B set:<tag> 
cab8d5
diff --git a/src/dhcp6.c b/src/dhcp6.c
cab8d5
index a827b2f..6cd30b5 100644
cab8d5
--- a/src/dhcp6.c
cab8d5
+++ b/src/dhcp6.c
cab8d5
@@ -538,7 +538,9 @@ static int construct_worker(struct in6_addr *local, int prefix,
cab8d5
 	  }
cab8d5
 	
cab8d5
       }
cab8d5
-    else if (addr6part(local) == addr6part(&template->start6) && wildcard_match(template->template_interface, ifrn_name))
cab8d5
+    else if ((addr6part(local) == addr6part(&template->start6) ||
cab8d5
+	      addr6part(local) == addr6part(&template->end6)) && 
cab8d5
+	     wildcard_match(template->template_interface, ifrn_name))
cab8d5
       {
cab8d5
 	start6 = *local;
cab8d5
 	setaddr6part(&start6, addr6part(&template->start6));
cab8d5
-- 
cab8d5
1.7.2.5
cab8d5