PacketFence - BTS - PacketFence
View Issue Details
0001268PacketFencecorepublic2011-09-15 09:562011-09-21 22:16
psnizek 
obilodeau 
normalminoralways
closedfixed 
2.2.1 
3.0.0 
a7bb8fbc89f05301c3497194fd13ec9d086af51a
0001268: omitting ip=|mask= parameter in pf.conf will throw unexpected exception
when omitting ip= or mask= in pf.conf

[interface eth0.2]
#ip=192.168.2.1
#mask=255.255.255.0
type=internal
gateway=192.168.2.1

an exception is thrown:

root@ar:/usr/local/pf/conf# ../bin/pfcmd checkup
Checking configuration sanity...
Can't call method "tag" on an undefined value at
        /usr/local/pf/lib/pf/pfcmd/checkup.pm line 156 (0000001)
    (F) You used the syntax of a method call, but the slot filled by the
    object reference or package name contains an undefined value. Something
    like this will reproduce the error:

        $BADREF = undef;
        process $BADREF 1,2,3;
        $BADREF->process(1,2,3);

Uncaught exception from user code:
        Can't call method "tag" on an undefined value at /usr/local/pf/lib/pf/pfcmd/checkup.pm line 156.
 at /usr/local/pf/lib/pf/pfcmd/checkup.pm line 156
        pf::pfcmd::checkup::interfaces() called at /usr/local/pf/lib/pf/pfcmd/checkup.pm line 77
        pf::pfcmd::checkup::sanity_check('named', 'dhcpd', 'httpd', 'snmptrapd', 'pfsetvlan', 'pfdhcplistener', 'pfmon') called at ../bin/pfcmd line 1356
        main::checkup() called at ../bin/pfcmd line 158
        main::__ANON__() called at ../bin/pfcmd line 215


When omitting gateway=

[interface eth0.2]
ip=192.168.2.1
mask=255.255.255.0
type=internal
#gateway=192.168.2.1

we have a much nicer output:

root@ar:/usr/local/pf/conf# ../bin/pfcmd checkup
Checking configuration sanity...
FATAL - incomplete network information for interface eth0.2
FATAL - incomplete network information for interface eth0.2

seems like if $interface in sub interfaces is undefined if one of both, ip= or mask=, is omitted in pf.conf.

No tags attached.
Issue History
2011-09-15 09:56psnizekNew Issue
2011-09-15 10:17psnizekNote Added: 0002208
2011-09-19 11:34obilodeauStatusnew => assigned
2011-09-19 11:34obilodeauAssigned To => obilodeau
2011-09-19 12:20obilodeaumtn revision => a7bb8fbc89f05301c3497194fd13ec9d086af51a
2011-09-19 12:20obilodeauNote Added: 0002214
2011-09-19 12:20obilodeauStatusassigned => resolved
2011-09-19 12:20obilodeauFixed in Version => trunk
2011-09-19 12:20obilodeauResolutionopen => fixed
2011-09-21 22:07obilodeauFixed in Versiontrunk => 3.0.0
2011-09-21 22:15obilodeauNote Added: 0002232
2011-09-21 22:16obilodeauStatusresolved => closed

Notes
(0002208)
psnizek   
2011-09-15 10:17   
forgot to mention... that includes typos like netmask= instead of mask=.
(0002214)
obilodeau   
2011-09-19 12:20   
Fixed in trunk. Avoiding to push undef as int_obj if interface was not properly defined. This is catched up later by checkup.

I don't think the fix will backport well to 2.2.x since my crash was somewhere else but you might want to try.
(0002232)
obilodeau   
2011-09-21 22:15   
fix released in 3.0