Skip to content

Commit

Permalink
Since 4.2.8/4.3.2 isc-dhcp-server started to check if prefix6 range is
Browse files Browse the repository at this point in the history
within declared subnet and if prefix6 network mask is bigger or equal
subnet mask. Remove these checks and make prefix delegation work as
expected.

For reference - https://redmine.pfsense.org/issues/4829

PR:		201601
Approved by:	zi (maintainer)
Sponsored by:	Netgate
  • Loading branch information
rbgarga committed Jul 16, 2015
1 parent 1a7b77b commit 3de9ed7
Show file tree
Hide file tree
Showing 4 changed files with 88 additions and 2 deletions.
2 changes: 1 addition & 1 deletion net/isc-dhcp42-server/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ LICENSE= ISCL
USES= gmake

PATCHLEVEL= P1
PORTREVISION_SERVER= 0
PORTREVISION_SERVER= 1
PORTREVISION_CLIENT= 0
PORTREVISION_RELAY= 0

Expand Down
43 changes: 43 additions & 0 deletions net/isc-dhcp42-server/files/patch-server_confpars.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
--- server/confpars.c.orig 2015-02-27 13:42:45 UTC
+++ server/confpars.c
@@ -3926,28 +3926,10 @@ parse_prefix6(struct parse *cfile, struc
return;
}

- /* Make sure starting prefix is within the subnet */
- if (!addr_eq(group->subnet->net,
- subnet_number(lo, group->subnet->netmask))) {
- parse_warn(cfile, "prefix6 start prefix"
- " is outside the subnet");
- skip_to_semi(cfile);
- return;
- }
-
if (!parse_ip6_addr(cfile, &hi)) {
return;
}

- /* Make sure ending prefix is within the subnet */
- if (!addr_eq(group->subnet->net,
- subnet_number(hi, group->subnet->netmask))) {
- parse_warn(cfile, "prefix6 end prefix"
- " is outside the subnet");
- skip_to_semi(cfile);
- return;
- }
-
/*
* Next is '/' number ';'.
*/
@@ -3970,11 +3952,6 @@ parse_prefix6(struct parse *cfile, struc
parse_warn(cfile, "networks have 0 to 128 bits (exclusive)");
return;
}
- if (bits < group->subnet->prefix_len) {
- parse_warn(cfile, "network mask smaller than subnet mask");
- skip_to_semi(cfile);
- return;
- }
if (!is_cidr_mask_valid(&lo, bits) ||
!is_cidr_mask_valid(&hi, bits)) {
parse_warn(cfile, "network mask too short");
2 changes: 1 addition & 1 deletion net/isc-dhcp43-server/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ LICENSE= ISCL
USES= gmake

#PATCHLEVEL= P1
PORTREVISION_SERVER= 0
PORTREVISION_SERVER= 1
PORTREVISION_CLIENT= 0
PORTREVISION_RELAY= 0

Expand Down
43 changes: 43 additions & 0 deletions net/isc-dhcp43-server/files/patch-server_confpars.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
--- server/confpars.c.orig 2015-02-26 19:35:43 UTC
+++ server/confpars.c
@@ -4161,28 +4161,10 @@ parse_prefix6(struct parse *cfile,
return;
}

- /* Make sure starting prefix is within the subnet */
- if (!addr_eq(group->subnet->net,
- subnet_number(lo, group->subnet->netmask))) {
- parse_warn(cfile, "prefix6 start prefix"
- " is outside the subnet");
- skip_to_semi(cfile);
- return;
- }
-
if (!parse_ip6_addr(cfile, &hi)) {
return;
}

- /* Make sure ending prefix is within the subnet */
- if (!addr_eq(group->subnet->net,
- subnet_number(hi, group->subnet->netmask))) {
- parse_warn(cfile, "prefix6 end prefix"
- " is outside the subnet");
- skip_to_semi(cfile);
- return;
- }
-
/*
* Next is '/' number ';'.
*/
@@ -4205,11 +4187,6 @@ parse_prefix6(struct parse *cfile,
parse_warn(cfile, "networks have 0 to 128 bits (exclusive)");
return;
}
- if (bits < group->subnet->prefix_len) {
- parse_warn(cfile, "network mask smaller than subnet mask");
- skip_to_semi(cfile);
- return;
- }
if (!is_cidr_mask_valid(&lo, bits) ||
!is_cidr_mask_valid(&hi, bits)) {
parse_warn(cfile, "network mask too short");

0 comments on commit 3de9ed7

Please sign in to comment.