From 86900805718897a590583bd8e924c2b6c1a84683 Mon Sep 17 00:00:00 2001 From: Oliver Gorwits Date: Sun, 6 Oct 2013 21:04:49 +0100 Subject: [PATCH] During macsuck get VLAN from Q-BRIDGE if available --- Netdisco/Changes | 1 + Netdisco/lib/App/Netdisco/Core/Macsuck.pm | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/Netdisco/Changes b/Netdisco/Changes index 22ea2aba..cb571299 100644 --- a/Netdisco/Changes +++ b/Netdisco/Changes @@ -10,6 +10,7 @@ * Update NodeWireless entries which match both MAC and SSID found, only * Fix SSL-proxy behaviour by using only path+query in links (W. Gould) * Avoid macsuck generated SQL bug when cleaning NULL VLAN (W. Gould) + * During macsuck get VLAN from Q-BRIDGE if available (jeneric) 2.017000 - 2013-09-23 diff --git a/Netdisco/lib/App/Netdisco/Core/Macsuck.pm b/Netdisco/lib/App/Netdisco/Core/Macsuck.pm index d97b3ccf..39dda17a 100644 --- a/Netdisco/lib/App/Netdisco/Core/Macsuck.pm +++ b/Netdisco/lib/App/Netdisco/Core/Macsuck.pm @@ -94,6 +94,10 @@ sub do_macsuck { $device->ip, $port, $vlan, scalar keys %{ $fwtable->{$vlan}->{$port} }; foreach my $mac (keys %{ $fwtable->{$vlan}->{$port} }) { + # get VLAN from Q-BRIDGE if available + $vlan = $fwtable->{$vlan}->{$port}->{$mac} + if $vlan == 0; + # remove vlan 0 entry for this MAC addr delete $fwtable->{0}->{$_}->{$mac} for keys %{ $fwtable->{0} }; @@ -382,7 +386,7 @@ sub _walk_fwtable { next unless setting('macsuck_bleed'); } - ++$cache->{$port}->{$mac}; + $cache->{$port}->{$mac} = ($fw_vlan->{$idx} || '0'); } return $cache;