Skip to content

Commit

Permalink
Close multicast listeners on stop
Browse files Browse the repository at this point in the history
On Android, if Yggdrasil is disabled, but multicast listeners are not
closed, it's stuck in some kind of live-lock:

  Connected inbound: 202:14b7:a:b:c:d:e:f@[a::b:c:d:e%wlan0]:37351, source [f::e:d:c:b%wlan0]:41127
  Disconnected inbound: 202:14b7:a:b:c:d:e:f@[a::b:c:d:e%wlan0]:37351, source [f::e:d:c:b%wlan0]:41127; error: ErrClosed
  ...

And the only way to resolve this issue is to restart the entire
process.
  • Loading branch information
bobrofon committed Aug 6, 2024
1 parent d615e0d commit cfb329b
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/multicast/multicast.go
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,12 @@ func (m *Multicast) _stop() error {
if m.sock != nil {
m.sock.Close()
}
for name, info := range m._listeners {
info.listener.Close()
m.log.Debugln("Stop multicasting on ", name)
}
clear(m._listeners)

return nil
}

Expand Down

0 comments on commit cfb329b

Please sign in to comment.