summaryrefslogtreecommitdiffhomepage
path: root/server/peer.go
diff options
context:
space:
mode:
authorHiroshi Yokoi <yokoi.hiroshi@po.ntts.co.jp>2015-06-30 14:30:49 +0900
committerHiroshi Yokoi <yokoi.hiroshi@po.ntts.co.jp>2015-07-01 14:26:36 +0900
commitc2709b81a2b3f9ee22c7f0049682efd829a82d96 (patch)
tree863590e1174f8169196cf93cdc02f97c9d3ad1e1 /server/peer.go
parent2e0ba39ce9b5d393fe64fa20d98598b8bb454d59 (diff)
server: apply distribute filter only when route server client propagates routes
Diffstat (limited to 'server/peer.go')
-rw-r--r--server/peer.go10
1 files changed, 4 insertions, 6 deletions
diff --git a/server/peer.go b/server/peer.go
index 1649b2c2..e1f5964f 100644
--- a/server/peer.go
+++ b/server/peer.go
@@ -172,10 +172,8 @@ func (peer *Peer) handleBGPmessage(m *bgp.BGPMessage) ([]*table.Path, bool, []*b
break
}
table.UpdatePathAttrs4ByteAs(body)
- originalPaths := table.ProcessMessage(m, peer.peerInfo)
- peer.adjRib.UpdateIn(originalPaths)
- // apply distribute filter before propagate
- pathList = applyPolicies(peer, nil, POLICY_DIRECTION_DISTRIBUTE, originalPaths)
+ pathList = table.ProcessMessage(m, peer.peerInfo)
+ peer.adjRib.UpdateIn(pathList)
}
return pathList, update, bgpMsgList
}
@@ -302,7 +300,7 @@ func (peer *Peer) ToApiStruct() *api.Peer {
}
}
-func (peer *Peer) setPolicy(policyMap map[string]*policy.Policy) {
+func (peer *Peer) setDistributePolicy(policyMap map[string]*policy.Policy) {
// configure distribute policy
policyConfig := peer.config.ApplyPolicy
distPolicies := make([]*policy.Policy, 0)
@@ -322,7 +320,7 @@ func (peer *Peer) setPolicy(policyMap map[string]*policy.Policy) {
}
-func (peer *Peer) applyPolicies(original table.Path) (bool, table.Path) {
+func (peer *Peer) applyDistributePolicies(original table.Path) (bool, table.Path) {
policies := peer.distPolicies
var d Direction = POLICY_DIRECTION_DISTRIBUTE