Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #6720 DHCP options by pool #3112

Merged
merged 2 commits into from Aug 29, 2016
Merged

Fix #6720 DHCP options by pool #3112

merged 2 commits into from Aug 29, 2016

Conversation

phil-davis
Copy link
Contributor

It is a little bit tricky having to generate the unique "option custom-if-n-m code ..." lines at first where n = pool index and m = item index in the items of the pool. Then make sure to reference that later, getting the same pool index into the array of pools. The $all_pools array as the "overall" or "base" pool first (at index 0), followed by the user-specified pools at index 1, 2, 3,... - which are actually at indexes 0, 1, 2,... in the ordinary array of pools in the config. So the -1 at line 910 has to happen.
But it works for me.

It is a little bit tricky having to generate the unique "option custom-if-n-m code ..." lines at first where n = pool index and m = item index in the items of the pool. Then make sure to reference that later, getting the same pool index into the array of pools. The $all_pools array as the "overall" or "base" pool first (at index 0), followed by the user-specified pools at index 1, 2, 3,... - which are actually at indexes 0, 1, 2,... in the ordinary array of pools in the config. So the -1 at line 910 has to happen.
But it works for me.
@phil-davis
Copy link
Contributor Author

In Redmine bug I have asked the OP to try this and report back. In my testing it produces dhcpd.conf files that look valid to me, but it would be nice to know that the clients then do actually get the specified options by pool for real.

@phil-davis
Copy link
Contributor Author

See bug report. OP has reported it is working for him. I added an extra indent to the "option custom..." line to make it line up nicely.

@netgate-git-updates netgate-git-updates merged commit c507161 into pfsense:master Aug 29, 2016
@phil-davis phil-davis deleted the patch-1 branch August 29, 2016 23:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants