Don't start multicast module if all Beacon and Listen are disabled

This commit is contained in:
Neil Alexander 2022-10-22 18:05:14 +01:00
parent 35ea66d651
commit 65e350153e

View File

@ -77,7 +77,11 @@ func (m *Multicast) _start() error {
if m._isOpen { if m._isOpen {
return fmt.Errorf("multicast module is already started") return fmt.Errorf("multicast module is already started")
} }
if len(m.config._interfaces) == 0 { var anyEnabled bool
for intf := range m.config._interfaces {
anyEnabled = anyEnabled || intf.Beacon || intf.Listen
}
if !anyEnabled {
return nil return nil
} }
m.log.Debugln("Starting multicast module") m.log.Debugln("Starting multicast module")