log mac expiry
for symmetry with mac discovery and w/o polluting the mac_cache code with logging
This commit is contained in:
1 parent
a7e44b44dc
commit
9706934d89
2 files changed
+10
-4
No files matched your search
@@ -15,9 +15,12 @@ import (
|
||||
const macMaxAge = 10 * time.Minute
|
||||
|
||||
func NewRouter(iface *net.Interface, name PeerName, password []byte, connLimit int, bufSz int, logFrame func(string, []byte, *layers.Ethernet)) *Router {
|
||||
onMacExpiry := func(mac net.HardwareAddr, peer *Peer) {
|
||||
log.Println("Expired MAC", mac, "at", peer.Name)
|
||||
}
|
||||
router := &Router{
|
||||
Iface: iface,
|
||||
Macs: NewMacCache(macMaxAge),
|
||||
Macs: NewMacCache(macMaxAge, onMacExpiry),
|
||||
Peers: NewPeerCache(),
|
||||
ConnLimit: connLimit,
|
||||
BufSz: bufSz,
|
||||
|
||||
Reference in new issue
Block a user