Revert "work for shortening or lengthening ports"

This reverts commit 9d48c4a025.
This commit is contained in:
Oliver Gorwits
2018-04-10 20:58:05 +01:00
parent 52e14aeeeb
commit 00f3f2a796

View File

@@ -259,8 +259,7 @@ sub store_neighbors {
ip => $peer_device->ip,
port => [
{'=', $remote_port},
{'-ilike', long_port($remote_port)},
{'-ilike', short_port($remote_port)},
{'-ilike', normalize_port($remote_port)},
{'-ilike', ('%'.quotemeta($remote_port))},
],
}, { rows => 1 })->single();
@@ -309,13 +308,7 @@ sub store_neighbors {
return @to_discover;
}
sub long_port {
my $port = shift or return '';
$port =~ s/^([a-z]{2})([^a-z].+)$/$1%$2/i;
return $port;
}
sub short_port {
sub normalize_port {
my $port = shift or return '';
my ($start, $end) = ('', '');
if ($port =~ m/^([a-z]{2})/i) { $start = $1 }