Skip to content

Commit c675324

Browse files
committed
Re-allow unspecified IPv6 local transport address
Fix regression introduced by 832b2d9 which breaks peerings with unspecified IPv6 local transport address. Signed-off-by: Rastislav Szabo <[email protected]>
1 parent 313096d commit c675324

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

pkg/server/server.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -880,7 +880,7 @@ func (s *BgpServer) toConfig(peer *peer, getAdvertised bool) *oc.Neighbor {
880880
if state == bgp.BGP_FSM_ESTABLISHED {
881881
peer.fsm.lock.RLock()
882882
conf.Transport.State.LocalAddress, conf.Transport.State.LocalPort = peer.fsm.LocalHostPort()
883-
if conf.Transport.Config.LocalAddress != netip.IPv4Unspecified().String() {
883+
if conf.Transport.Config.LocalAddress != netip.IPv4Unspecified().String() && conf.Transport.Config.LocalAddress != netip.IPv6Unspecified().String() {
884884
conf.Transport.State.LocalAddress = conf.Transport.Config.LocalAddress
885885
}
886886
_, conf.Transport.State.RemotePort = peer.fsm.RemoteHostPort()
@@ -1620,7 +1620,7 @@ func (s *BgpServer) handleFSMMessage(peer *peer, e *fsmMsg) {
16201620
// exclude zone info
16211621
ipaddr, _ := net.ResolveIPAddr("ip", laddr)
16221622
peer.fsm.peerInfo.LocalAddress = ipaddr.IP
1623-
if peer.fsm.pConf.Transport.Config.LocalAddress != netip.IPv4Unspecified().String() {
1623+
if peer.fsm.pConf.Transport.Config.LocalAddress != netip.IPv4Unspecified().String() && peer.fsm.pConf.Transport.Config.LocalAddress != netip.IPv6Unspecified().String() {
16241624
peer.fsm.peerInfo.LocalAddress = net.ParseIP(peer.fsm.pConf.Transport.Config.LocalAddress)
16251625
peer.fsm.pConf.Transport.State.LocalAddress = peer.fsm.pConf.Transport.Config.LocalAddress
16261626
}

0 commit comments

Comments
 (0)