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
DHCP Patch for Correct MAC Limitations #4066
Conversation
reb00tz
commented
May 15, 2019
•
edited by rbgarga
edited by rbgarga
- Redmine Issue: https://redmine.pfsense.org/issues/1605
- Ready for review
git pull origin master
As per: pfsense@3590f5e#r289076521: added _explicit_ if-else clause to catch "disabled", just in case engine is ever changed where ``isset("disabled") == true``.
…d hosts without fixed IPs Fixed bug when restricting DHCP classes (i.e. when ``$poolconf['denyunknown']=="class"``) accidentally ignoring declared hosts that are not explicitly assigned fixed IPs.
Fixed bug when restricting DHCP classes accidentally ignoring declare…
Modified as suggested: https://github.com/pfsense/pfsense/pull/4066/files/3590f5ebb732cb900bc9045eb60b6b365a052b3b#r290902061 (pfsense#595-pfsense#599) https://github.com/pfsense/pfsense/pull/4066/files/3590f5ebb732cb900bc9045eb60b6b365a052b3b#r290902550 (pfsense#892) https://github.com/pfsense/pfsense/pull/4066/files/3590f5ebb732cb900bc9045eb60b6b365a052b3b#r290903116 (pfsense#893) https://github.com/pfsense/pfsense/pull/4066/files/3590f5ebb732cb900bc9045eb60b6b365a052b3b#r290903231 (pfsense#894) https://github.com/pfsense/pfsense/pull/4066/files/3590f5ebb732cb900bc9045eb60b6b365a052b3b#r290903410 (pfsense#896-pfsense#898)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed commented out code (previously line pfsense#850) upon @rbgarga's request (as per pfSense PR 4066).
Note: The Redmine issue for this is actually https://redmine.pfsense.org/issues/1605 (the newer one was a duplicate) |
src/etc/inc/services.inc
Outdated
// subclass for DHCP limiting | ||
// unknown if the "1:" prefix is still needed, so adding it just in case | ||
$dhcpdconf .= "subclass \"s_{$dhcpif}\" 1:{$sm['mac']};\n"; | ||
$dhcpdconf .= "subclass \"s_{$dhcpif}\" {$sm['mac']};\n"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For ethernet connections the subtype is 1 so 1:
prefix is mandatory. The line without it and the comment can be removed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done!
src/etc/inc/services.inc
Outdated
@@ -841,7 +844,13 @@ EOPP; | |||
$dhcpdconf .= " $deny_action dynamic bootp clients;\n"; | |||
} | |||
|
|||
if (isset($poolconf['denyunknown'])) { | |||
// set pool MAC limitations | |||
if ($poolconf['denyunknown'] == "class") { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if $poolconf['denyunknown']
is not set PHP will throw a warning. Make sure it is set before try to use its value
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done!
Added $poolconf['denyunknown'] guard check as per @rbgarga's warning (https://github.com/pfsense/pfsense/pull/4066/files/6d9ab9b7d5dcb1cf7da1cc678f6aae2a3cfc6207#r323684343)
Removed incorrect DHCP subclass non-prefixed MACs as per rbarga's warning (https://github.com/pfsense/pfsense/pull/4066/files#r323683287). Also edited inline comments.
Superseded by #4066 |