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

This commit is contained in:
Jakob Borg 2014-06-14 11:14:37 +02:00
parent 537c6b3b69
commit 9ca87f5314

View File

@ -83,7 +83,7 @@ func (b *Beacon) writer() {
var dsts []net.IP var dsts []net.IP
for _, addr := range addrs { 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) baddr := bcast(iaddr)
dsts = append(dsts, baddr.IP) dsts = append(dsts, baddr.IP)
} }