From 65e350153eeba16ab47386963a8e705a22dd2cc8 Mon Sep 17 00:00:00 2001 From: Neil Alexander Date: Sat, 22 Oct 2022 18:05:14 +0100 Subject: [PATCH] Don't start multicast module if all `Beacon` and `Listen` are disabled --- src/multicast/multicast.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/multicast/multicast.go b/src/multicast/multicast.go index d40bcfc0..84d5933a 100644 --- a/src/multicast/multicast.go +++ b/src/multicast/multicast.go @@ -77,7 +77,11 @@ func (m *Multicast) _start() error { if m._isOpen { 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 } m.log.Debugln("Starting multicast module")