Project

General

Profile

Bug #15418 » status_dhcpv6_leases.php.patch

fix for issue - Patrik Stahlman, 04/18/2024 05:34 PM

View differences:

usr/local/www/status_dhcpv6_leases.php 2024-04-16 02:00:41.000000000 +0200 → usr/local/www/status_dhcpv6_leases.php 2024-04-18 18:32:15.120704000 +0200
191 191
foreach (config_get_path('interfaces', []) as $ifname => $ifarr) {
192 192
       if (is_array($config['dhcpdv6'][$ifname]) &&
193 193
           is_array($config['dhcpdv6'][$ifname]['staticmap'])) {
194
               foreach ($config['dhcpdv6'][$ifname]['staticmap'] as $static) {
194
               foreach ($config['dhcpdv6'][$ifname]['staticmap'] as $idx => $static) {
195 195
                       $slease = array();
196 196
                       $slease['ip'] = merge_ipv6_delegated_prefix(get_interface_ipv6($ifname), $static['ipaddrv6'], get_interface_subnetv6($ifname));
197 197
                       $slease['type'] = "static";
......
205 205
                       } else {
206 206
                               $slease['online'] = $offline_string;
207 207
                       }
208
                       $slease['staticmap_array_index'] = $idx;
208 209

  
209 210
                       $leases[] = $slease;
210 211
               }
......
346 347
               $icon = 'fa-solid fa-user';
347 348
       }
348 349

  
350
       $data['if'] = convert_real_interface_to_friendly_interface_name(guess_interface_from_ip($data['ip']));
351

  
349 352
       if ($data['act'] !== $static_string) {
350 353
               foreach (config_get_path('dhcpdv6', []) as $dhcpif => $dhcpifconf) {
351 354
                       if (empty($dhcpifconf)) {
......
355 358
                       if (!is_array($dhcpifconf['range']) || !isset($dhcpifconf['enable'])) {
356 359
                               continue;
357 360
                       }
358

  
359
                       $data['if'] = convert_real_interface_to_friendly_interface_name(guess_interface_from_ip($data['ip']));
360 361

  
361 362
                       if (is_inrange_v6($data['ip'], $dhcpifconf['range']['from'], $dhcpifconf['range']['to'])) {
362 363
                               $dlskey = $data['if'] . '-' . $dhcpifconf['range']['from'];
    (1-1/1)