From 444bc1e81dbbdc189a11d1ae6bb259c948815233 Mon Sep 17 00:00:00 2001 From: Oliver Gorwits Date: Mon, 13 Jan 2014 17:51:54 +0000 Subject: [PATCH] protect sprintf from undefined remote_type --- Netdisco/lib/App/Netdisco/Core/Discover.pm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Netdisco/lib/App/Netdisco/Core/Discover.pm b/Netdisco/lib/App/Netdisco/Core/Discover.pm index a546aa39..8ac82e6c 100644 --- a/Netdisco/lib/App/Netdisco/Core/Discover.pm +++ b/Netdisco/lib/App/Netdisco/Core/Discover.pm @@ -733,7 +733,7 @@ sub store_neighbors { foreach my $n (@$remote_ip) { debug sprintf ' [%s] neigh - adding neighbor %s, type [%s], on %s to discovery queue', - $device->ip, $n, $remote_type, $port; + $device->ip, $n, ($remote_type || ''), $port; push @to_discover, [$n, $remote_type]; } } @@ -747,7 +747,7 @@ sub store_neighbors { if (wantarray) { debug sprintf ' [%s] neigh - adding neighbor %s, type [%s], on %s to discovery queue', - $device->ip, $remote_ip, $remote_type, $port; + $device->ip, $remote_ip, ($remote_type || ''), $port; push @to_discover, [$remote_ip, $remote_type]; } @@ -894,7 +894,7 @@ sub discover_new_neighbors { if (not is_discoverable($device, $remote_type)) { debug sprintf ' queue - %s, type [%s] excluded by discover_* config', - $ip, $remote_type; + $ip, ($remote_type || ''); next; }