Project

General

Profile

« Previous | Next » 

Revision 49878b9e

Added by Phil Davis over 10 years ago

Add static mapping interface not set when IP in a pool

If the DHCP IP address is in a pool (not in the main DHCP range for the interface) then the interface that corresponds to the IP address is not found. This results in the link to "add static mapping for this MAC address" not having any value for "if=" and thus clicking on the "+" button does not work.
Reported in bug 4649
Process any pools when checking for which interface contains the IP address.

View differences:

usr/local/www/status_dhcp_leases.php
371 371
					$data['if'] = $dhcpif;
372 372
					break;
373 373
				}
374
				// Check if the IP is in the range of any DHCP pools
375
				if (is_array($dhcpifconf['pool'])) {
376
					foreach ($dhcpifconf['pool'] as $dhcppool) {
377
						if (is_array($dhcppool['range'])) {
378
							if (($lip >= ip2ulong($dhcppool['range']['from'])) && ($lip <= ip2ulong($dhcppool['range']['to']))) {
379
								$data['if'] = $dhcpif;
380
								break 2;
381
							}
382
						}
383
					}
384
				}
374 385
			}
375 386
		}
376 387
		echo "<tr>\n";

Also available in: Unified diff