From f2ebd07c076f8ce0e5b9dafc6043ea74cf5b6e04 Mon Sep 17 00:00:00 2001 From: Oliver Gorwits Date: Wed, 18 Apr 2018 21:11:54 +0100 Subject: [PATCH] #393 avoid "modification of readonly variable" error in netmap --- Changes | 1 + lib/App/Netdisco/Web/Plugin/Device/Neighbors.pm | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/Changes b/Changes index 6fad14ec..c1570af2 100644 --- a/Changes +++ b/Changes @@ -2,6 +2,7 @@ [BUG FIXES] + * #393 avoid 'modification of readonly variable' error in netmap * clean up check_mac() interface (ml-cms) 2.039021 - 2018-04-10 diff --git a/lib/App/Netdisco/Web/Plugin/Device/Neighbors.pm b/lib/App/Netdisco/Web/Plugin/Device/Neighbors.pm index 894be030..7155e1d0 100644 --- a/lib/App/Netdisco/Web/Plugin/Device/Neighbors.pm +++ b/lib/App/Netdisco/Web/Plugin/Device/Neighbors.pm @@ -6,6 +6,7 @@ use Dancer::Plugin::DBIC; use Dancer::Plugin::Auth::Extensible; use SNMP::Info (); +use Storable 'dclone'; use List::Util 'first'; use List::MoreUtils (); use App::Netdisco::Util::Permission 'check_acl_only'; @@ -96,7 +97,8 @@ sub make_node_infostring { } sub make_link_infostring { - my $link = shift or return ''; + my $linkarg = shift or return ''; + my $link = dclone $link; my $domain = quotemeta( setting('domain_suffix') || '' ); (my $left_name = lc($link->{left_dns} || $link->{left_name} || $link->{left_ip})) =~ s/$domain$//;