From 67cff45c16a5482b4e2a0f5264a2f1ef83f9cf31 Mon Sep 17 00:00:00 2001 From: Jiri Popelka Date: Wed, 23 Jan 2013 17:45:45 +0100 Subject: [PATCH] Make sure range6 is correct for subnet6 where it's declared (#902966) --- dhcp-4.2.5-range6.patch | 42 +++++++++++++++++++++++++++++++++++++++++ dhcp.spec | 10 +++++++++- 2 files changed, 51 insertions(+), 1 deletion(-) create mode 100644 dhcp-4.2.5-range6.patch diff --git a/dhcp-4.2.5-range6.patch b/dhcp-4.2.5-range6.patch new file mode 100644 index 0000000..754d899 --- /dev/null +++ b/dhcp-4.2.5-range6.patch @@ -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. + */ diff --git a/dhcp.spec b/dhcp.spec index 5d8add4..416cd8b 100644 --- a/dhcp.spec +++ b/dhcp.spec @@ -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 - 12:4.2.5-4 +- Make sure range6 is correct for subnet6 where it's declared (#902966) + * Fri Jan 18 2013 Jiri Popelka - 12:4.2.5-3 - simplify the previously added triggerun scriptlet