Undestrand ipv6 peer addresses
Fix as outlined by in PR 239.
@@ -20,6 +20,7 @@ import (
"net"
"reflect"
"sort"
+ "strconv"
"time"
"go.universe.tf/metallb/internal/bgp"
@@ -153,7 +154,7 @@ func (c *bgpController) syncPeers(l log.Logger) error {
if p.cfg.RouterID != nil {
routerID = p.cfg.RouterID
}
- s, err := newBGP(c.logger, fmt.Sprintf("%s:%d", p.cfg.Addr, p.cfg.Port), p.cfg.MyASN, routerID, p.cfg.ASN, p.cfg.HoldTime, p.cfg.Password)
+ s, err := newBGP(c.logger, net.JoinHostPort(p.cfg.Addr.String(), strconv.Itoa(int(p.cfg.Port))), p.cfg.MyASN, routerID, p.cfg.ASN, p.cfg.HoldTime, p.cfg.Password)
if err != nil {
l.Log("op", "syncPeers", "error", err, "peer", p.cfg.Addr, "msg", "failed to create BGP session")
errs++
