Make sure range6 is correct for subnet6 where it's declared (#902966)

This commit is contained in:
Jiri Popelka 2013-01-23 17:45:45 +01:00
parent a0cdea387c
commit 67cff45c16
2 changed files with 51 additions and 1 deletions

42
dhcp-4.2.5-range6.patch Normal file
View File

@ -0,0 +1,42 @@
diff --git a/server/confpars.c b/server/confpars.c
index 12ab0e6..4454be9 100644
--- a/server/confpars.c
+++ b/server/confpars.c
@@ -3756,6 +3756,19 @@ add_ipv6_pool_to_subnet(struct subnet *subnet, u_int16_t type,
share->ipv6_pools[num_pools+1] = NULL;
}
+static void
+check_addr_in_subnet(struct subnet *subnet, struct iaddr *addr) {
+ char lowbuf [INET6_ADDRSTRLEN], netbuf [INET6_ADDRSTRLEN];
+
+ if (!addr_eq(subnet->net, subnet_number(*addr, subnet->netmask))) {
+ strcpy(lowbuf, piaddr(*addr));
+ strcpy(netbuf, piaddr(subnet->net));
+ log_fatal("bad range6, address %s not in subnet6 %s/%d",
+ lowbuf, netbuf, subnet->prefix_len);
+ }
+
+}
+
/* address-range6-declaration :== ip-address6 ip-address6 SEMI
| ip-address6 SLASH number SEMI
| ip-address6 [SLASH number] TEMPORARY SEMI */
@@ -3788,6 +3801,8 @@ parse_address_range6(struct parse *cfile, struct group *group) {
return;
}
+ check_addr_in_subnet(group->subnet, &lo);
+
/*
* See if we we're using range or CIDR notation or TEMPORARY
*/
@@ -3855,6 +3870,8 @@ parse_address_range6(struct parse *cfile, struct group *group) {
return;
}
+ check_addr_in_subnet(group->subnet, &hi);
+
/*
* Convert our range to a set of CIDR networks.
*/

View File

@ -18,7 +18,7 @@
Summary: Dynamic host configuration protocol software
Name: dhcp
Version: 4.2.5
Release: 3%{?dist}
Release: 4%{?dist}
# NEVER CHANGE THE EPOCH on this package. The previous maintainer (prior to
# dcantrell maintaining the package) made incorrect use of the epoch and
# that's why it is at 12 now. It should have never been used, but it was.
@ -78,6 +78,7 @@ Patch43: dhcp-4.2.5b1-atf-pkgconfig.patch
Patch44: dhcp-4.2.4-P1-interval.patch
Patch45: dhcp-4.2.4-P2-conflex-do-forward-updates.patch
Patch46: dhcp-4.2.4-P2-dupl-key.patch
Patch47: dhcp-4.2.5-range6.patch
BuildRequires: autoconf
BuildRequires: automake
@ -334,6 +335,10 @@ rm -rf includes/isc-dhcp
# (Submitted to dhcp-bugs@isc.org - [ISC-Bugs #31892])
%patch46 -p1 -b .dupl-key
# Make sure range6 is correct for subnet6 where it's declared (#902966)
# (Submitted to dhcp-bugs@isc.org - [ISC-Bugs #32453])
%patch47 -p1 -b .range6
# Update paths in all man pages
for page in client/dhclient.conf.5 client/dhclient.leases.5 \
client/dhclient-script.8 client/dhclient.8 ; do
@ -577,6 +582,9 @@ done
%changelog
* Wed Jan 23 2013 Jiri Popelka <jpopelka@redhat.com> - 12:4.2.5-4
- Make sure range6 is correct for subnet6 where it's declared (#902966)
* Fri Jan 18 2013 Jiri Popelka <jpopelka@redhat.com> - 12:4.2.5-3
- simplify the previously added triggerun scriptlet