* Sat Sep 27 2025 Brian Read <brianr@koozali.org> 2.0.4-24.sme
- Fix crash in network scan [SME: 13180] - Remove spinners as no longer necessary [SME: 13189]
This commit is contained in:
@@ -483,19 +483,31 @@ sub get_mac_address {
|
||||
open(my $fh, '<', $file) or die "Could not open file '$file' $!";
|
||||
my $mac_address = undef;
|
||||
my $lease_block;
|
||||
while(my $line = <$fh>) {
|
||||
if($line =~ /lease $ip {/ .. $line =~ /}/) {
|
||||
$lease_block .= $line;
|
||||
if($line =~ /}/) {
|
||||
if($lease_block =~ /hardware ethernet (\S+);/) {
|
||||
$mac_address = $1;
|
||||
last;
|
||||
} else {
|
||||
$lease_block = '';
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
my $in_lease;
|
||||
while (my $line = <$fh>) {
|
||||
# Start of the lease block for the requested IP
|
||||
if ($line =~ /^lease\s+\Q$ip\E\s*{/) {
|
||||
$in_lease = 1;
|
||||
$lease_block = $line;
|
||||
next;
|
||||
}
|
||||
# If inside the lease block, accumulate lines
|
||||
if ($in_lease) {
|
||||
$lease_block .= $line;
|
||||
|
||||
# Look for hardware ethernet line to capture MAC
|
||||
if ($line =~ /hardware ethernet\s+(\S+);/) {
|
||||
$mac_address = $1;
|
||||
}
|
||||
|
||||
# End of lease block
|
||||
if ($line =~ /^}/) {
|
||||
$in_lease = 0;
|
||||
last if $mac_address; # Exit if MAC found
|
||||
$lease_block = ''; # Reset if MAC not found
|
||||
}
|
||||
}
|
||||
}
|
||||
close $fh;
|
||||
return $mac_address;
|
||||
}
|
||||
@@ -699,6 +711,4 @@ sub Perform_Wake_Up($){
|
||||
}
|
||||
|
||||
|
||||
1;
|
||||
|
||||
|
||||
1;
|
@@ -56,7 +56,7 @@
|
||||
'dhcpd_REMOVE' => 'Remove',
|
||||
'dhcpd_SAVE/RESTART' => 'Save/Restart',
|
||||
'dhcpd_SAVE_TITLE' => 'After changing settings above, you must save and restart dhcpd.',
|
||||
'dhcpd_SCANNING_NETWORK_TITLE' => 'Scanning your network, the time needed depends of your subnet mask',
|
||||
'dhcpd_SCANNING_NETWORK_TITLE' => 'Scanning your network, the time needed depends on your subnet mask',
|
||||
'dhcpd_SCAN_YOUR_NETWORK' => 'Scan your network',
|
||||
'dhcpd_SCAN_YOUR_NETWORK_TITLE' => 'Scan your network to show active devices :',
|
||||
'dhcpd_SECONDARY_DNS_ADDRESS' => 'Secondary DNS',
|
||||
@@ -88,4 +88,4 @@
|
||||
contents of that lease are written to the end of the file. This means that it is entirely possible for there to be two
|
||||
or more declarations of the same lease in the lease file at the same
|
||||
time. In that case, the instance of that particular lease that
|
||||
appears last in the file is the one that is in effect.',
|
||||
appears last in the file is the one that is in effect.',
|
Reference in New Issue
Block a user