Selaa lähdekoodia

Don't attempt to use broadcast with IPv6 (ref #346)

Jakob Borg 11 vuotta sitten
vanhempi
sitoutus
9ca87f5314
1 muutettua tiedostoa jossa 1 lisäystä ja 1 poistoa
  1. 1 1
      beacon/beacon.go

+ 1 - 1
beacon/beacon.go

@@ -83,7 +83,7 @@ func (b *Beacon) writer() {
 
 		var dsts []net.IP
 		for _, addr := range addrs {
-			if iaddr, ok := addr.(*net.IPNet); ok && iaddr.IP.IsGlobalUnicast() {
+			if iaddr, ok := addr.(*net.IPNet); ok && iaddr.IP.IsGlobalUnicast() && iaddr.IP.To4() != nil {
 				baddr := bcast(iaddr)
 				dsts = append(dsts, baddr.IP)
 			}