From dbec787c7b3724f5f694036402fdbc001433955d Mon Sep 17 00:00:00 2001 From: ISHIDA Wataru Date: Sun, 4 Oct 2015 16:19:27 +0900 Subject: server: support global policy Signed-off-by: ISHIDA Wataru --- server/server.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'server/server.go') diff --git a/server/server.go b/server/server.go index 38c4ea63..7557cf70 100644 --- a/server/server.go +++ b/server/server.go @@ -668,6 +668,7 @@ func (server *BgpServer) propagateUpdate(peer *Peer, pathList []*table.Path) []* } } else { rib := server.globalRib + pathList = rib.ApplyPolicy(table.POLICY_DIRECTION_IMPORT, pathList) sendPathList, _ := rib.ProcessPaths(pathList) if len(sendPathList) == 0 { return msgs @@ -679,7 +680,7 @@ func (server *BgpServer) propagateUpdate(peer *Peer, pathList []*table.Path) []* if targetPeer.isRouteServerClient() || targetPeer.fsm.state != bgp.BGP_FSM_ESTABLISHED { continue } - f := filterpath(targetPeer, sendPathList) + f := rib.ApplyPolicy(table.POLICY_DIRECTION_EXPORT, filterpath(targetPeer, sendPathList)) if len(f) == 0 { continue } @@ -864,6 +865,7 @@ func (server *BgpServer) SetPolicy(pl config.RoutingPolicy) { } server.policyMap = pMap server.routingPolicy = pl + server.globalRib.SetPolicy(server.bgpConfig.Global.ApplyPolicy, server.policyMap) } func (server *BgpServer) handlePolicy(pl config.RoutingPolicy) { -- cgit v1.2.3