-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Closed
Description
The AI's great intelligence told me how to fix it:
go-libp2p/p2p/host/basic/addrs_manager.go
Line 660 in 7b7c3ed
| ifaceAddrs, err := manet.InterfaceMultiaddrs() |
Replace to:
// Resolve the interface addresses
ifaceAddrs, err := anet.InterfaceAddrs()
if err != nil {
// This usually shouldn't happen, but we could be in some kind
// of funky restricted environment.
log.Errorw("failed to resolve local interface addresses", "error", err)
// Add the loopback addresses to the filtered addrs and use them as the non-filtered addrs.
// Then bail. There's nothing else we can do here.
i.filtered = append(i.filtered, manet.IP4Loopback, manet.IP6Loopback)
i.all = i.filtered
return
}
// remove link local ipv6 addresses
for _, addr := range ifaceAddrs {
if ipNet, ok := addr.(*net.IPNet); ok {
if maddr, err := manet.FromIP(ipNet.IP); err == nil && !manet.IsIP6LinkLocal(maddr) {
i.all = append(i.all, maddr)
}
}
}
and
go-libp2p/p2p/host/basic/addrs_manager.go
Line 711 in 7b7c3ed
| for j := range len(addrs) { |
Replace to:
i := 0
for j = 0; j < len(addrs); j++ {
if addrs[j] != nil {
addrs[i], addrs[j] = addrs[j], addrs[i]
i++
}
}
Metadata
Metadata
Assignees
Labels
No labels