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

    MAC filtering error

    Scheduled Pinned Locked Moved General pfSense Questions
    7 Posts 3 Posters 1.4k 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.
    • S
      samham
      last edited by

      I'm getting the following error after applying a MAC filter under DHCP, however the entry is save and functional

      line 239 Warning: in_array() expects parameter 2 to be array, null given in /etc/inc/unbound.inc on
      line 239 Warning: in_array() expects parameter 2 to be array, null given in /etc/inc/unbound.inc on
      line 239 Warning: in_array() expects parameter 2 to be array, null given in /etc/inc/unbound.inc on
      line 239 Warning: in_array() expects parameter 2 to be array, null given in /etc/inc/unbound.inc on

      1 Reply Last reply Reply Quote 0
      • BBcan177B
        BBcan177 Moderator
        last edited by

        That unbound error is related to DNS Servers .. Line 239 in Red.

        // Set up forwarding if it is configured
                if (isset($config['unbound']['forwarding'])) {
                        $dnsservers = array();
                        if (isset($config['system']['dnsallowoverride'])) {
                                $ns = array_unique(get_nameservers());
                                foreach($ns as $nameserver) {
                                        if ($nameserver)
                                                $dnsservers[] = $nameserver;
                                }
                        }
                        $sys_dnsservers = array_unique(get_dns_servers());
                        foreach ($sys_dnsservers as $sys_dnsserver) {
                                if ($sys_dnsserver && (!in_array($sys_dnsserver, $ns))) {
                                        $dnsservers[] = $sys_dnsserver;
                                }
                        }

        "Experience is something you don't get until just after you need it."

        Website: http://pfBlockerNG.com
        Twitter: @BBcan177  #pfBlockerNG
        Reddit: https://www.reddit.com/r/pfBlockerNG/new/

        1 Reply Last reply Reply Quote 0
        • S
          samham
          last edited by

          thank you for the reply, how to fix/prevent the error ?

          1 Reply Last reply Reply Quote 0
          • BBcan177B
            BBcan177 Moderator
            last edited by

            @samham:

            thank you for the reply, how to fix/prevent the error ?

            You can post a bug report in Redmine.

            It seems you enabled "Forwarding mode" in Unbound, and its trying to read your DNS servers but they are probably not defined. So when it runs the code and hits line 239, the foreach fails because the $sys_dnsservers array is empty.. You could try manually editing that code (at your own risk )  :)    Adding the lines in Red below..

            // Set up forwarding if it is configured
                    if (isset($config['unbound']['forwarding'])) {
                            $dnsservers = array();
                            if (isset($config['system']['dnsallowoverride'])) {
                                    $ns = array_unique(get_nameservers());
                                    foreach ($ns as $nameserver) {
                                            if ($nameserver)
                                                    $dnsservers[] = $nameserver;
                                    }
                            }
                            $sys_dnsservers = array_unique(get_dns_servers());
                          if (!empty($sys_dnsservers)) {
                                    foreach ($sys_dnsservers as $sys_dnsserver) {
                                            if ($sys_dnsserver && (!in_array($sys_dnsserver, $ns))) {
                                                    $dnsservers[] = $sys_dnsserver;
                                            }
                                    }
                            }

            if (!empty($dnsservers)) {
                                    $forward_conf .=<<

            "Experience is something you don't get until just after you need it."

            Website: http://pfBlockerNG.com
            Twitter: @BBcan177  #pfBlockerNG
            Reddit: https://www.reddit.com/r/pfBlockerNG/new/

            1 Reply Last reply Reply Quote 0
            • D
              doktornotor Banned
              last edited by

              @BBcan177:

              @samham:

              thank you for the reply, how to fix/prevent the error ?

              You can post a bug report in Redmine.

              Nooooo. This been fixed about 1 month ago.

              1 Reply Last reply Reply Quote 0
              • S
                samham
                last edited by

                I'm already running 2.2.2 are you saying it was fixed in version 2.2.2 or will it be included post 2.2.2?

                1 Reply Last reply Reply Quote 0
                • D
                  doktornotor Banned
                  last edited by

                  No, it has not been fixed in 2.2.2. Either use a 2.2.3 snapshot or apply the patch manually.

                  https://redmine.pfsense.org/projects/pfsense/repository/revisions/98615a3156d86aed1a560f109087d7e1ad4bf990

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