Multicast interface detection and shutdown tweaks

May help with #1173.
This commit is contained in:
Neil Alexander 2024-09-29 20:58:10 +01:00
parent 43a1a3de64
commit c00779c7d3
No known key found for this signature in database
GPG Key ID: A02A2019A2BB0944
2 changed files with 6 additions and 1 deletions

View File

@ -422,7 +422,10 @@ func (l *links) listen(u *url.URL, sintf string) (*Listener, error) {
li := &Listener{
listener: listener,
ctx: ctx,
Cancel: cancel,
Cancel: func() {
cancel()
_ = listener.Close()
},
}
var options linkOptions

View File

@ -190,6 +190,8 @@ func (m *Multicast) _getAllowedInterfaces() map[string]*interfaceInfo {
switch {
case iface.Flags&net.FlagUp == 0:
continue // Ignore interfaces that are down
case iface.Flags&net.FlagRunning == 0:
continue // Ignore interfaces that are not running
case iface.Flags&net.FlagMulticast == 0:
continue // Ignore non-multicast interfaces
case iface.Flags&net.FlagPointToPoint != 0: