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

    Missing Function

    Scheduled Pinned Locked Moved Development
    2 Posts 2 Posters 919 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.
    • BBcan177B
      BBcan177 Moderator
      last edited by

      I think there is a missing function (and should be unreferenced)-

      subnetv6_expand()

      I think it would be bad anyways to expand an IPv6 /64…

      But just pointing out that the function subnet_expand() should be re-written to address this issue.

      Expanding an IPv6 /64 would probably causes memory issues in PHP  :)

      18,446,744,073,709,551,616 IPv6 addresses in a /64

      /etc/inc/util.inc

      function subnet_expand($subnet) {
              if (is_subnetv4($subnet)) {
                      return subnetv4_expand($subnet);
              } else if (is_subnetv6($subnet)) {
                      return subnetv6_expand($subnet);
              } else {
                      return $subnet;
              }
      }

      "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
      • P
        phil.davis
        last edited by

        Yes, that is a latent issue waiting for some sucker to try and call it with an IPv6 address!

        subnetv4_expand() is called directly from a couple of places in the base system and works.

        subnet_expand() is not called by anything in the base system.

        subnetv6_expand() is only mentioned inside subnet_expand()

        and yes, I can't imagine anything that would require and handle subnetv6_expand() of a /64 (or bigger)!
        The only small use for this would be in some places where there are pools. e.g. for V4 it is used in vslb.inc where people can have put a virtual server pool by specifying a "subnet" like 10.11.12.8/29 gives a pool of 8 IP addresses. The front-end GUI code limits it to a maximum size pool of 64 (x.x.x.x/26).
        I guess the same possibility of having a group of servers with IP addresses in a tiny IPv6 "subnet" would also work.

        The reference to a non-existent function was introduced in 2012 by:
        https://github.com/pfsense/pfsense/commit/0917cb214b2bbf7f4b374c901c642987fc4ac63b

        As the Greek philosopher Isosceles used to say, "There are 3 sides to every triangle."
        If I helped you, then help someone else - buy someone a gift from the INF catalog http://secure.inf.org/gifts/usd/

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