diff --git a/client.go b/client.go index 1fb9771..562bc62 100644 --- a/client.go +++ b/client.go @@ -75,18 +75,21 @@ loop: if !timer.Stop() { <-timer.C } - bo.reset() - c.conn.loadIfaces() now = time.Now() + bo.reset() + _, err := c.conn.loadIfaces() + if err != nil { + c.opts.logger.Warn("reload failed (ifaces unchanged)", "err", err) + } c.opts.logger.Debug("reload", "ifaces", c.conn.ifaces) case m, ok := <-msgCh: if !timer.Stop() { <-timer.C } + now = time.Now() if !ok { break loop } - now = time.Now() msg = &m case now = <-timer.C: } diff --git a/dual_conn.go b/dual_conn.go index cf49016..abbf7ac 100644 --- a/dual_conn.go +++ b/dual_conn.go @@ -72,13 +72,16 @@ func newDualConn(ifacesFn func() ([]net.Interface, error), network string) (*dua func (c *dualConn) loadIfaces() (changed bool, err error) { ifaces := make(map[int]*Interface) // new ifaces netIfaces, err := c.ifacesFn() + if err != nil { + return false, err + } for _, netIface := range netIfaces { if !isMulticastInterface(netIface) { continue } v4, v6, err := netIfaceAddrs(netIface) if err != nil { - continue + return false, err } iface := &Interface{Interface: netIface} // Join will fail if called multiple times, just attempt for now