Diff of /Netdisco/lib/App/Netdisco/Core/Macsuck.pm [4b6e21] .. [0fcd55] Maximize Restore

  Switch to side-by-side view

--- a/Netdisco/lib/App/Netdisco/Core/Macsuck.pm
+++ b/Netdisco/lib/App/Netdisco/Core/Macsuck.pm
@@ -129,6 +129,7 @@
 sub store_node {
   my ($ip, $vlan, $port, $mac, $now) = @_;
   $now ||= 'now()';
+  $vlan ||= 0;
 
   schema('netdisco')->txn_do(sub {
     my $nodes = schema('netdisco')->resultset('Node');
@@ -157,13 +158,13 @@
     my $new = $nodes->search({
       'me.switch' => $ip,
       'me.port' => $port,
+      'me.vlan' => $vlan,
       'me.mac' => $mac,
     });
 
     # new data
     $new->update_or_create(
       {
-        vlan => $vlan,
         active => \'true',
         oui => substr($mac,0,8),
         time_last => \$now,