Eliminate MacCache Start method
This commit is contained in:
1 parent
a311623bb9
commit
d6bceb139e
2 files changed
+2
-5
No files matched your search
+2
-4
@@ -22,14 +22,12 @@ type MacCache struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func NewMacCache(maxAge time.Duration, onExpiry func(net.HardwareAddr, *Peer)) *MacCache {
|
func NewMacCache(maxAge time.Duration, onExpiry func(net.HardwareAddr, *Peer)) *MacCache {
|
||||||
return &MacCache{
|
cache := &MacCache{
|
||||||
table: make(map[uint64]*MacCacheEntry),
|
table: make(map[uint64]*MacCacheEntry),
|
||||||
maxAge: maxAge,
|
maxAge: maxAge,
|
||||||
onExpiry: onExpiry}
|
onExpiry: onExpiry}
|
||||||
}
|
|
||||||
|
|
||||||
func (cache *MacCache) Start() {
|
|
||||||
cache.setExpiryTimer()
|
cache.setExpiryTimer()
|
||||||
|
return cache
|
||||||
}
|
}
|
||||||
|
|
||||||
func (cache *MacCache) Enter(mac net.HardwareAddr, peer *Peer) bool {
|
func (cache *MacCache) Enter(mac net.HardwareAddr, peer *Peer) bool {
|
||||||
|
|||||||
@@ -96,7 +96,6 @@ func (router *Router) Start() {
|
|||||||
checkFatal(err)
|
checkFatal(err)
|
||||||
}
|
}
|
||||||
router.Ourself.Start()
|
router.Ourself.Start()
|
||||||
router.Macs.Start()
|
|
||||||
router.Routes.Start()
|
router.Routes.Start()
|
||||||
router.ConnectionMaker.Start()
|
router.ConnectionMaker.Start()
|
||||||
router.UDPListener = router.listenUDP(router.Port, po)
|
router.UDPListener = router.listenUDP(router.Port, po)
|
||||||
|
|||||||
Reference in new issue
Block a user