File tree Expand file tree Collapse file tree 2 files changed +6
-3
lines changed Expand file tree Collapse file tree 2 files changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -9,6 +9,7 @@ inventory:
99netdiscovery/netinventory:
1010* PR #836 from @eduardomozart: Enhanced HP wireless printers by reporting wifi ports
1111 as wireless
12+ * Fix network ports ip support to avoid wrong allocation in rare cases, seen on a Ricoh printer
1213
1314packaging:
1415* Update Windows MSI packing building process to use:
Original file line number Diff line number Diff line change @@ -625,8 +625,10 @@ sub _setGenericProperties {
625625 foreach my $suffix (sort keys %{$results }) {
626626 my $value = $results -> {$suffix };
627627 next unless $value ;
628+ # value must match IFNUMBER
629+ my $portindex = first { $ports -> {$_ }-> {IFNUMBER } eq $value } keys (%{$ports });
628630 # safety checks
629- if (! exists $ports -> { $value } ) {
631+ unless ( $portindex ) {
630632 $logger -> debug(
631633 " unknown interface $value for IP address $suffix , ignoring"
632634 ) if $logger ;
@@ -636,8 +638,8 @@ sub _setGenericProperties {
636638 $logger -> debug(" invalid IP address $suffix " ) if $logger ;
637639 next ;
638640 }
639- $ports -> {$value }-> {IP } = $suffix ;
640- push @{$ports -> {$value }-> {IPS }-> {IP }}, $suffix ;
641+ $ports -> {$portindex }-> {IP } = $suffix ;
642+ push @{$ports -> {$portindex }-> {IPS }-> {IP }}, $suffix ;
641643 }
642644
643645 $device -> {PORTS }-> {PORT } = $ports ;
You can’t perform that action at this time.
0 commit comments