lib/beacon: Only send to appropriately flagged interfaces (ref #5957) (#6404)

saves some traffic (potential mobile wakeups), may help with #5957.
This commit is contained in:
Alex Xu
2020-03-17 09:40:37 +01:00
committed by GitHub
parent f08d09f607
commit 1e68ab3f90
2 changed files with 21 additions and 5 deletions
+4
View File
@@ -67,6 +67,10 @@ func writeMulticasts(ctx context.Context, inbox <-chan []byte, addr string) erro
success := 0
for _, intf := range intfs {
if intf.Flags&net.FlagMulticast == 0 {
continue
}
wcm.IfIndex = intf.Index
pconn.SetWriteDeadline(time.Now().Add(time.Second))
_, err = pconn.WriteTo(bs, wcm, gaddr)