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