From aa5aa798e61689adf18d35d101425a3a304c620b Mon Sep 17 00:00:00 2001 From: Jeremy Stretch Date: Mon, 25 Sep 2017 14:33:32 -0400 Subject: [PATCH] Fixes #1486: Ignore subinterface IDs when validating LLDP neighbor connections --- netbox/templates/dcim/device_lldp_neighbors.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/netbox/templates/dcim/device_lldp_neighbors.html b/netbox/templates/dcim/device_lldp_neighbors.html index a7346c5db..99c1f6465 100644 --- a/netbox/templates/dcim/device_lldp_neighbors.html +++ b/netbox/templates/dcim/device_lldp_neighbors.html @@ -53,7 +53,7 @@ $(document).ready(function() { success: function(json) { $.each(json['get_lldp_neighbors'], function(iface, neighbors) { var neighbor = neighbors[0]; - var row = $('#' + iface.replace(/(\/)/g, "\\$1")); + var row = $('#' + iface.split(".")[0].replace(/(\/)/g, "\\$1")); var configured_device = row.children('td.configured_device').attr('data'); var configured_interface = row.children('td.configured_interface').attr('data'); // Add LLDP neighbors to table @@ -62,7 +62,7 @@ $(document).ready(function() { // Apply colors to rows if (!configured_device && neighbor['hostname']) { row.addClass('info'); - } else if (configured_device == neighbor['hostname'] && configured_interface == neighbor['port']) { + } else if (configured_device == neighbor['hostname'] && configured_interface == neighbor['port'].split(".")[0]) { row.addClass('success'); } else { row.addClass('danger');