* 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:
2025-09-27 15:51:46 +01:00
parent dc15d53296
commit 0d0b1733a9
7 changed files with 68 additions and 140 deletions

View File

@@ -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;