Bug in /etc/rc.linkup pfSense 1.2.3

  • A bug was found in rc.linkup which prevented DHCP addresses for OPTX interfaces from being acquired when the pfSense box was booted before the DHCP server.

    Looking at rc.linkup the problem is pretty obvious.  When a HOTPLUG event is detected for an OPTX interace the following code gets executed to configure the interface.

                                                    $int = str_replace("opt", "", $interface);
                                                    echo "interfaces_optional_configure_if($int);\n";
                                                    log_error("HOTPLUG: Configuring optional interface {$interface} - opt{$int}");
    The variable $interface is not defined anywhere so $int gets a value of "".  interfaces_optional_configure_if($int) gets called with a bogus argument and the interface does not get configured.

    replacing $interface with $iface fixes the problem.  After the modification doing a hotplug of the any of the OPT interfaces configured with DHCP works.

    The code for /etc/rc.linkup under pf2.0 has changed considerably from the 1.2.3 version. I suspect that this problem was resolved under 2.0 a while back.



  • Here is a second bug in rc.linkup


    for ($i = 1; $i <= $_SERVER['argc']; $i++) {
                                    $argspassed .= $_SERVER['argv'][$i] . " ";
                                    $argument1 = $_SERVER['argv'][$i];
                                    $argument2 = $_SERVER['argv'][$i+1];
                                    handle_argument_group($argument1, $argument2);

    calls handle_argument_group too many times with bogus arguments the second and 3rd time through… It should be replaced by

    for ($i = 1; $i < $_SERVER['argc']; ) {
                                    $argument1 = $_SERVER['argv'][$i++];
                                    $argument2 = $_SERVER['argv'][$i++];
                                    handle_argument_group($argument1, $argument2);

  • Rebel Alliance Developer Netgate

    That was a known issue with 1.2.x, but has been fixed a long time ago in 2.0.

    1.2.x won't be receiving any more updates, 2.0 is right around the corner.