From c2709b81a2b3f9ee22c7f0049682efd829a82d96 Mon Sep 17 00:00:00 2001 From: Hiroshi Yokoi Date: Tue, 30 Jun 2015 14:30:49 +0900 Subject: server: apply distribute filter only when route server client propagates routes --- server/peer.go | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'server/peer.go') 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 -- cgit v1.2.3