mirror of
https://github.com/jgoerzen/xbnet.git
synced 2025-01-03 12:08:21 -04:00
reduce debugging
This commit is contained in:
parent
f4a71fd32c
commit
e89f5f17e2
@ -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
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user