Skip to content

Commit

Permalink
Multicast interface detection and shutdown tweaks
Browse files Browse the repository at this point in the history
May help with #1173.
  • Loading branch information
neilalexander committed Sep 29, 2024
1 parent 43a1a3d commit c00779c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/core/link.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions src/multicast/multicast.go
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit c00779c

Please sign in to comment.