PacketFence - BTS - PacketFence
View Issue Details
0001563PacketFenceweb adminpublic2012-09-29 16:152015-02-13 15:42
candlerb 
 
normalmajoralways
closedopen 
3.5.1 
investigate 
0001563: Adding an interface without IP breaks the GUI
When adding a new monitor interface (configuration->interfaces), if you leave the IP and netmask blank it is accepted by the GUI and added to the config:

---
[interface eth0]
ip=
mask=
type=monitor
enforcement=
---

However from that point onwards the GUI is screwed. The initial response is

----
Error: Problems executing 'PFCMD interfaceconfig get all'

could not parse at /usr/local/pf/lib/pf/config.pm line 362
----

but a bunch of other web pages are broken, e.g. if you go to Configuration > Main you get two sets of backtraces including

----
could not parse at /usr/local/pf/lib/pf/config.pm line 362
";s:7:"configs";b:0;s:15:"current_heading";s:0:"";}'> Warning: Invalid argument supplied for foreach() in /usr/local/pf/html/admin/configuration/main.php on line 143
----

This continues until you fix the configuration manually, i.e. open pf.conf, and either add an IP address and netmask to the interface in question, or delete the interface.

The line referred to in the first error above is
$int_obj = new Net::Netmask( $ip, $mask );
so clearly the IP/mask must be valid, but the GUI lets you submit empty values, and pfcmd doesn't reject them either.

There are two possible resolutions I can see:

1. validate the IP address before adding it to the config (in pfcmd and/or GUI)
or
2. allow interfaces without IP and netmask. This would be useful for monitor interfaces.
No tags attached.
Issue History
2012-09-29 16:15candlerbNew Issue
2012-10-19 11:05fgaudreaultTarget Version => investigate
2015-02-13 15:42lmunroNote Added: 0003825
2015-02-13 15:42lmunroStatusnew => closed

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