bug fix for openbsd -i

This commit is contained in:
Harald Hope 2022-06-10 13:29:28 -07:00
parent 35e8a95055
commit 354c44eb76

20
inxi
View file

@ -18297,6 +18297,7 @@ sub advanced_data_bsd {
($cont_if,$ind_if) = (1,2);
}
foreach my $item (@ifs_bsd){
if (ref $item ne 'ARRAY'){
$working_if = $item;
# print "$working_if\n";
@ -18337,11 +18338,11 @@ sub advanced_data_bsd {
$rows->[$j]{main::key($num++,0,$ind_if,'duplex')} = $duplex;
}
$rows->[$j]{main::key($num++,0,$ind_if,'mac')} = $mac;
}
if ($show{'ip'} && $if){
if_ip($rows,$key,$if);
}
}
}
eval $end if $b_log;
}
## values:
@ -18353,7 +18354,7 @@ sub advanced_data_bsd {
sub if_ip {
eval $start if $b_log;
my ($rows,$type,$if) = @_;
my (@data,$working_if);
my ($working_if);
my ($cont_ip,$ind_ip) = (3,4);
my $num = 0;
my $j = 0;
@ -18368,17 +18369,14 @@ sub if_ip {
# print "if:$if wif:$working_if\n";
next;
}
else {
@data = @$item;
# print "ref:$item\n";
}
if ($working_if eq $if){
foreach my $data2 (@data){
# print "if $if item:\n", Data::Dumper::Dumper $item;
foreach my $data2 (@$item){
$j = scalar @$rows;
$num = 1;
if ($limit > 0 && $j >= $limit){
push(@$rows, {
main::key($num++,0,$cont_ip,'Message') => main::message('output-limit',scalar @data),
main::key($num++,0,$cont_ip,'Message') => main::message('output-limit',scalar @$item),
});
last OUTER;
}
@ -28713,14 +28711,12 @@ sub set_ifconfig {
$scope = $2;
}
$scope = 'link' if $ip =~ /^fe80/;
@temp = ($type,$ip,$broadcast,$scope,$if_id);
push(@ips,[@temp]);
push(@ips,[$type,$ip,$broadcast,$scope,$if_id]);
# print Data::Dumper::Dumper \@ips;
}
}
if (@ips){
@temp = ($if,[@ips]);
push(@ifs,@temp);
push(@ifs,($if,[@ips]));
}
if ($mac){
@temp = ($if,[($state,$speed,$duplex,$mac)]);