serve dlna: only select interfaces which can multicast for SSDP

Before this change we used all UP interfaces - now we need the
interfaces to be UP and MULTICAST capable.

See: https://forum.rclone.org/t/error-using-rclone-serve-dlna-on-termux/11083
This commit is contained in:
Nick Craig-Wood 2019-08-16 10:16:37 +01:00
parent 6ca00c21a4
commit 27a9d0f570

View File

@ -47,10 +47,9 @@ func listInterfaces() []net.Interface {
var active []net.Interface
for _, intf := range ifs {
if intf.Flags&net.FlagUp == 0 || intf.MTU <= 0 {
continue
if intf.Flags&net.FlagUp != 0 && intf.Flags&net.FlagMulticast != 0 && intf.MTU > 0 {
active = append(active, intf)
}
active = append(active, intf)
}
return active
}