bug fix for openbsd -i

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

24
inxi
View file

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