File tree 1 file changed +3
-2
lines changed
1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -21,6 +21,7 @@ import (
21
21
"errors"
22
22
"fmt"
23
23
"net"
24
+ "net/netip"
24
25
"reflect"
25
26
"strconv"
26
27
"sync"
@@ -879,7 +880,7 @@ func (s *BgpServer) toConfig(peer *peer, getAdvertised bool) *oc.Neighbor {
879
880
if state == bgp .BGP_FSM_ESTABLISHED {
880
881
peer .fsm .lock .RLock ()
881
882
conf .Transport .State .LocalAddress , conf .Transport .State .LocalPort = peer .fsm .LocalHostPort ()
882
- if conf .Transport .Config .LocalAddress != "0.0.0.0" {
883
+ if conf .Transport .Config .LocalAddress != netip . IPv4Unspecified (). String () {
883
884
conf .Transport .State .LocalAddress = conf .Transport .Config .LocalAddress
884
885
}
885
886
_ , conf .Transport .State .RemotePort = peer .fsm .RemoteHostPort ()
@@ -1619,7 +1620,7 @@ func (s *BgpServer) handleFSMMessage(peer *peer, e *fsmMsg) {
1619
1620
// exclude zone info
1620
1621
ipaddr , _ := net .ResolveIPAddr ("ip" , laddr )
1621
1622
peer .fsm .peerInfo .LocalAddress = ipaddr .IP
1622
- if peer .fsm .pConf .Transport .Config .LocalAddress != "0.0.0.0" {
1623
+ if peer .fsm .pConf .Transport .Config .LocalAddress != netip . IPv4Unspecified (). String () {
1623
1624
peer .fsm .peerInfo .LocalAddress = net .ParseIP (peer .fsm .pConf .Transport .Config .LocalAddress )
1624
1625
peer .fsm .pConf .Transport .State .LocalAddress = peer .fsm .pConf .Transport .Config .LocalAddress
1625
1626
}
You can’t perform that action at this time.
0 commit comments