File tree 2 files changed +6
-3
lines changed
2 files changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -9,6 +9,7 @@ inventory:
9
9
netdiscovery/netinventory:
10
10
* PR #836 from @eduardomozart: Enhanced HP wireless printers by reporting wifi ports
11
11
as wireless
12
+ * Fix network ports ip support to avoid wrong allocation in rare cases, seen on a Ricoh printer
12
13
13
14
packaging:
14
15
* Update Windows MSI packing building process to use:
Original file line number Diff line number Diff line change @@ -625,8 +625,10 @@ sub _setGenericProperties {
625
625
foreach my $suffix (sort keys %{$results }) {
626
626
my $value = $results -> {$suffix };
627
627
next unless $value ;
628
+ # value must match IFNUMBER
629
+ my $portindex = first { $ports -> {$_ }-> {IFNUMBER } eq $value } keys (%{$ports });
628
630
# safety checks
629
- if (! exists $ports -> { $value } ) {
631
+ unless ( $portindex ) {
630
632
$logger -> debug(
631
633
" unknown interface $value for IP address $suffix , ignoring"
632
634
) if $logger ;
@@ -636,8 +638,8 @@ sub _setGenericProperties {
636
638
$logger -> debug(" invalid IP address $suffix " ) if $logger ;
637
639
next ;
638
640
}
639
- $ports -> {$value }-> {IP } = $suffix ;
640
- push @{$ports -> {$value }-> {IPS }-> {IP }}, $suffix ;
641
+ $ports -> {$portindex }-> {IP } = $suffix ;
642
+ push @{$ports -> {$portindex }-> {IPS }-> {IP }}, $suffix ;
641
643
}
642
644
643
645
$device -> {PORTS }-> {PORT } = $ports ;
You can’t perform that action at this time.
0 commit comments