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

DHCP Patch for Correct MAC Limitations #4066

Closed
wants to merge 10 commits into from
Closed

Conversation

reb00tz
Copy link
Contributor

@reb00tz reb00tz commented May 15, 2019

src/etc/inc/services.inc Outdated Show resolved Hide resolved
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…
src/usr/local/www/services_dhcp.php Outdated Show resolved Hide resolved
src/usr/local/www/services_dhcp.php Outdated Show resolved Hide resolved
src/usr/local/www/services_dhcp.php Outdated Show resolved Hide resolved
src/usr/local/www/services_dhcp.php Outdated Show resolved Hide resolved
src/usr/local/www/services_dhcp.php Show resolved Hide resolved
src/etc/inc/services.inc Outdated Show resolved Hide resolved
Copy link
Contributor Author

@reb00tz reb00tz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Addressed code enhancements by both @rbgarga and @jim-p.

src/etc/inc/services.inc Outdated Show resolved Hide resolved
src/etc/inc/services.inc Outdated Show resolved Hide resolved
src/usr/local/www/services_dhcp.php Show resolved Hide resolved
src/usr/local/www/services_dhcp.php Outdated Show resolved Hide resolved
src/usr/local/www/services_dhcp.php Outdated Show resolved Hide resolved
src/usr/local/www/services_dhcp.php Outdated Show resolved Hide resolved
src/usr/local/www/services_dhcp.php Outdated Show resolved Hide resolved
src/etc/inc/services.inc Outdated Show resolved Hide resolved
src/etc/inc/services.inc Outdated Show resolved Hide resolved
Removed commented out code (previously line pfsense#850) upon @rbgarga's request (as per pfSense PR 4066).
@jim-p
Copy link
Contributor

jim-p commented Sep 11, 2019

Note: The Redmine issue for this is actually https://redmine.pfsense.org/issues/1605 (the newer one was a duplicate)

// 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";
Copy link
Member

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

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done!

@@ -841,7 +844,13 @@ EOPP;
$dhcpdconf .= " $deny_action dynamic bootp clients;\n";
}

if (isset($poolconf['denyunknown'])) {
// set pool MAC limitations
if ($poolconf['denyunknown'] == "class") {
Copy link
Member

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

Copy link
Contributor Author

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 Show resolved Hide resolved
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.
@rbgarga
Copy link
Member

rbgarga commented Feb 7, 2020

Superseded by #4066

@rbgarga rbgarga closed this Feb 7, 2020
@reb00tz
Copy link
Contributor Author

reb00tz commented Mar 14, 2020

@rbgarga: I think this should be "Superseded by #4184".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants