From 9339c1a2cead264c35eb5dd9dc078ba7b19eec26 Mon Sep 17 00:00:00 2001 From: Oliver Gorwits Date: Mon, 9 Apr 2018 23:15:58 +0100 Subject: [PATCH] no need for quotemeta --- lib/App/Netdisco/Worker/Plugin/Discover/Neighbors.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/App/Netdisco/Worker/Plugin/Discover/Neighbors.pm b/lib/App/Netdisco/Worker/Plugin/Discover/Neighbors.pm index 5e15a56f..532443c2 100644 --- a/lib/App/Netdisco/Worker/Plugin/Discover/Neighbors.pm +++ b/lib/App/Netdisco/Worker/Plugin/Discover/Neighbors.pm @@ -261,7 +261,7 @@ sub store_neighbors { {'=', $remote_port}, {'-ilike', long_port($remote_port)}, {'-ilike', short_port($remote_port)}, - {'-ilike', ('%'.quotemeta($remote_port))}, + {'-ilike', ('%'. $remote_port)}, ], }, { rows => 1 })->single(); if ($peer_port and ($peer_port->port ne $remote_port)) { @@ -311,7 +311,7 @@ sub store_neighbors { sub long_port { my $port = shift or return ''; - $port =~ s/^([a-z]{2})([^a-z].+)$/$1%$2/i; + $port =~ s/^([a-z]{2})(\d.+)$/$1%$2/i; return $port; }