reduce debugging

This commit is contained in:
John Goerzen 2020-09-24 22:27:12 -05:00
parent f4a71fd32c
commit e89f5f17e2

View File

@ -74,25 +74,20 @@ impl XBTun {
}
pub fn get_xb_dest_mac(&self, ipaddr: &IpAddr) -> u64 {
trace!("Looking up destination for {}", ipaddr);
if self.broadcast_everything {
trace!("broadcast_everything is on, so broadcast");
return XB_BROADCAST;
}
match self.dests.lock().unwrap().get(ipaddr) {
// Broadcast if we don't know it
None => {
trace!("Destination not in map");
XB_BROADCAST
},
Some((dest, expiration)) => {
if Instant::now() >= *expiration {
// Broadcast it if the cache entry has expired
trace!("Destination expired");
XB_BROADCAST
} else {
trace!("Destination {} found", dest);
*dest
}
}