summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--server/peer.go2
-rw-r--r--table/path.go8
2 files changed, 5 insertions, 5 deletions
diff --git a/server/peer.go b/server/peer.go
index f239033a..2feb4d86 100644
--- a/server/peer.go
+++ b/server/peer.go
@@ -162,7 +162,7 @@ func (peer *Peer) filterpath(path *table.Path, withdrawals []*table.Path) *table
// remove local-pref attribute
// we should do this after applying export policy since policy may
// set local-preference
- if path != nil && peer.fsm.pConf.Config.PeerType == config.PEER_TYPE_EXTERNAL {
+ if path != nil && !peer.isIBGPPeer() && !peer.isRouteServerClient() {
path.RemoveLocalPref()
}
return path
diff --git a/table/path.go b/table/path.go
index 0aab6004..b07c01e1 100644
--- a/table/path.go
+++ b/table/path.go
@@ -160,6 +160,10 @@ func cloneAsPath(asAttr *bgp.PathAttributeAsPath) *bgp.PathAttributeAsPath {
}
func (path *Path) UpdatePathAttrs(global *config.Global, peer *config.Neighbor) {
+ if peer.RouteServer.Config.RouteServerClient {
+ return
+ }
+
for _, a := range path.GetPathAttrs() {
if _, y := bgp.PathAttrFlags[a.GetType()]; !y {
if a.GetFlags()&bgp.BGP_ATTR_FLAG_TRANSITIVE == 0 {
@@ -168,10 +172,6 @@ func (path *Path) UpdatePathAttrs(global *config.Global, peer *config.Neighbor)
}
}
- if peer.RouteServer.Config.RouteServerClient {
- return
- }
-
localAddress := net.ParseIP(peer.Transport.State.LocalAddress)
isZero := func(ip net.IP) bool {
return ip.Equal(net.ParseIP("0.0.0.0")) || ip.Equal(net.ParseIP("::"))