From 3ccd107bd48357892263353ba93e37a171317522 Mon Sep 17 00:00:00 2001 From: Oliver Gorwits Date: Sat, 7 Oct 2017 14:13:58 +0100 Subject: [PATCH] fix bug in device->has_layer --- lib/App/Netdisco/DB/Result/Device.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/App/Netdisco/DB/Result/Device.pm b/lib/App/Netdisco/DB/Result/Device.pm index 6ee06a01..6352e444 100644 --- a/lib/App/Netdisco/DB/Result/Device.pm +++ b/lib/App/Netdisco/DB/Result/Device.pm @@ -212,8 +212,8 @@ Returns true if the device provided sysServices and supports the given layer. sub has_layer { my ($device, $layer) = @_; - return unless $layer and $layer =~ m/^[1-8]$/; - return $device->layers and substr($device->layers, (9-$layer), 1) == 1; + return unless $layer and $layer =~ m/^[1-7]$/; + return ($device->layers and (substr($device->layers, (8-$layer), 1) == 1)); } =head2 renumber( $new_ip )