PacketFence - BTS - PacketFence
View Issue Details
0001564PacketFenceconfigurationpublic2012-09-29 16:422015-02-13 15:42
candlerb 
 
normalminoralways
closedopen 
3.5.1 
 
0001564: Default enforcement "only if type internal" does not apply
The web interface default selection for enforcement is "only if type internal"

This maps to
    enforcement=
in pf.conf

However AFAICS this does not actually work, you need to explicitly set VLAN enforcement (enforcement=vlan)

If you don't do this, then shouldBeStarted is 0 for dhcpd, so you can't start it. This is a difficult problem to debug, involving tracing back through the source code until you find:

* dhcpd isn't in the list of services_which_should_be_started unless is_vlan_enforcement_enabled() is true
* lib/pf/config.pm: is_vlan_enforcement_enabled() only returns true if at least one interface has enforcement=vlan

The simplest fix is to change the GUI so that enforcement=<empty string> renders as "No" instead of "only if type internal"

The alternative is to implement the functionality as advertised. If so, I suggest:

1. change readPfConfigFiles to set @vlan_enforcement_nets based on the more complex logic

            if ( $type eq 'internal' ) {
                push @internal_nets, $int_obj;
                if ($Config{$interface}{'enforcement'} eq $IF_ENFORCEMENT_VLAN
                    || !$Config{$interface}{'enforcement'} ) {
                  push @vlan_enforcement_nets, $int_obj;

2. change is_vlan_enforcement_enabled() to return true if @vlan_enforcement_nets is not empty (to avoid duplicating this logic)
No tags attached.
Issue History
2012-09-29 16:42candlerbNew Issue
2012-10-19 11:04fgaudreaultTarget Version => general
2015-02-13 15:42lmunroNote Added: 0003826
2015-02-13 15:42lmunroStatusnew => closed

Notes
(0003826)
lmunro   
2015-02-13 15:42   
These bugs have been sitting untouched since 2012.
Closing them and possibly reopening in github tracker where relevant.