Refactoring: move tuntap and icmpv6 into separate package

This commit is contained in:
Neil Alexander 2019-03-28 00:30:25 +00:00
parent 67c670ab4c
commit 0b494a8255
No known key found for this signature in database
GPG key ID: A02A2019A2BB0944
20 changed files with 307 additions and 240 deletions

View file

@ -23,9 +23,8 @@ func (m *multicast) init(core *Core) {
m.core = core
m.reconfigure = make(chan chan error, 1)
m.listeners = make(map[string]*tcpListener)
m.core.configMutex.RLock()
m.listenPort = m.core.config.LinkLocalTCPPort
m.core.configMutex.RUnlock()
current, _ := m.core.config.Get()
m.listenPort = current.LinkLocalTCPPort
go func() {
for {
e := <-m.reconfigure
@ -70,9 +69,8 @@ func (m *multicast) start() error {
func (m *multicast) interfaces() map[string]net.Interface {
// Get interface expressions from config
m.core.configMutex.RLock()
exprs := m.core.config.MulticastInterfaces
m.core.configMutex.RUnlock()
current, _ := m.core.config.Get()
exprs := current.MulticastInterfaces
// Ask the system for network interfaces
interfaces := make(map[string]net.Interface)
allifaces, err := net.Interfaces()