summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--server/peer.go2
-rw-r--r--table/path.go4
2 files changed, 3 insertions, 3 deletions
diff --git a/server/peer.go b/server/peer.go
index eeae0556..96e014db 100644
--- a/server/peer.go
+++ b/server/peer.go
@@ -272,7 +272,7 @@ func (peer *Peer) filterpath(path, old *table.Path) *table.Path {
}
path = path.Clone(path.IsWithdraw)
- path.UpdatePathAttrs(peer.fsm.gConf, peer.fsm.pConf)
+ path.UpdatePathAttrs(peer.fsm.gConf, peer.fsm.pConf, peer.fsm.peerInfo)
options := &table.PolicyOptions{
Info: peer.fsm.peerInfo,
diff --git a/table/path.go b/table/path.go
index f90cd06a..82af18c1 100644
--- a/table/path.go
+++ b/table/path.go
@@ -163,7 +163,7 @@ func cloneAsPath(asAttr *bgp.PathAttributeAsPath) *bgp.PathAttributeAsPath {
return bgp.NewPathAttributeAsPath(newASparams)
}
-func (path *Path) UpdatePathAttrs(global *config.Global, peer *config.Neighbor) {
+func (path *Path) UpdatePathAttrs(global *config.Global, peer *config.Neighbor, info *PeerInfo) {
if peer.RouteServer.Config.RouteServerClient {
return
}
@@ -176,7 +176,7 @@ func (path *Path) UpdatePathAttrs(global *config.Global, peer *config.Neighbor)
}
}
- localAddress := net.ParseIP(peer.Transport.State.LocalAddress)
+ localAddress := info.LocalAddress
isZero := func(ip net.IP) bool {
return ip.Equal(net.ParseIP("0.0.0.0")) || ip.Equal(net.ParseIP("::"))
}