summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>2015-10-04 16:19:27 +0900
committerFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2015-10-09 20:28:01 +0900
commitdbec787c7b3724f5f694036402fdbc001433955d (patch)
tree1933e0da12acd8bdfb680d2edc67ac4daeecc743
parent352d8e2056fceb3bc0e85f5b8436f7eff0f44711 (diff)
server: support global policy
Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
-rw-r--r--server/server.go4
1 files changed, 3 insertions, 1 deletions
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) {