Commit 8b287210 authored by Mike Hibler's avatar Mike Hibler

Workaround to detect the MAC address of a node changing in the DB.

Because Interface.pm caches DB state, we might not pick up on this
if someone just changes the DB directly (who would do such a thing?)
parent ed50b520
......@@ -322,8 +322,18 @@ sub findnode($$)
# XXX this should never happen since dhcpd looked up the IP by mac.
if ($iface->mac() ne $mac) {
logit("$IP: came in on $mac but expected " . $iface->mac());
return undef;
#
# XXX okay, one way it might happen is if someone changes the
# DB behind our back (the Interface module caches DB info).
# So we retry once after flushing the cache.
#
$iface->Flush();
$iface = Interface->LookupByIP($IP);
if (!$iface || $iface->mac() ne $mac) {
logit("$IP: came in on $mac but expected " . $iface->mac())
if ($iface);
return undef;
}
}
return $iface->node_id();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment