Netgate Discussion Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Search
    • Register
    • Login

    Bug in /etc/rc.linkup pfSense 1.2.3

    Scheduled Pinned Locked Moved DHCP and DNS
    3 Posts 2 Posters 1.8k Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • L
      lsoltero
      last edited by

      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.

      default:
                                                      $int = str_replace("opt", "", $interface);
                                                      interfaces_optional_configure_if($int);
                                                      echo "interfaces_optional_configure_if($int);\n";
                                                      log_error("HOTPLUG: Configuring optional interface {$interface} - opt{$int}");
                                                      break;
      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.

      Thanks,

      –luis

      1 Reply Last reply Reply Quote 0
      • L
        lsoltero
        last edited by

        Here is a second bug in rc.linkup

        this

        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);
                                }

        1 Reply Last reply Reply Quote 0
        • jimpJ
          jimp Rebel Alliance Developer Netgate
          last edited by

          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.

          Remember: Upvote with the 👍 button for any user/post you find to be helpful, informative, or deserving of recognition!

          Need help fast? Netgate Global Support!

          Do not Chat/PM for help!

          1 Reply Last reply Reply Quote 0
          • First post
            Last post
          Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.