Fix IP count when showing just one subnet
authorJamie Cameron <jcameron@webmin.com>
Mon, 18 May 2009 18:43:25 +0000 (18:43 +0000)
committerJamie Cameron <jcameron@webmin.com>
Mon, 18 May 2009 18:43:25 +0000 (18:43 +0000)
dhcpd/list_leases.cgi

index c8a7f68..5f0d0bc 100755 (executable)
@@ -26,6 +26,12 @@ foreach $shared (&find("shared-network", $conf)) {
        push(@subnets, &find("subnet", $shared->{'members'}));
        }
 foreach $subnet (@subnets) {
+       if ($in{'network'}) {
+               # Only count ranges in specified subnet
+               if ($subnet->{'values'}->[0] ne $in{'network'}) {
+                       next;
+                       }
+               }
        $subnet->{'ips'} = 0;
        foreach $range (&find("range", $subnet->{'members'})) {
                local @rv = @{$range->{'values'}};