diff options
author | Wataru Ishida <ishida.wataru@lab.ntt.co.jp> | 2016-11-06 06:58:37 +0000 |
---|---|---|
committer | Wataru Ishida <ishida.wataru@lab.ntt.co.jp> | 2016-11-06 07:44:04 +0000 |
commit | 4534be26098f7a90e8bc515d697c259762bdaeb7 (patch) | |
tree | b6d51df1a53b946fa5c319c838c227ac105e2f1f /server/server.go | |
parent | e4cd6e08f66c80a17230b709ede67f40d62969ce (diff) |
server: fix bug of disable/enable/softreset behavior for vrfed neighbor
Signed-off-by: Wataru Ishida <ishida.wataru@lab.ntt.co.jp>
Diffstat (limited to 'server/server.go')
-rw-r--r-- | server/server.go | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/server/server.go b/server/server.go index c86b2af2..263bc00c 100644 --- a/server/server.go +++ b/server/server.go @@ -427,6 +427,9 @@ func (server *BgpServer) notifyBestWatcher(best map[string][]*table.Path, multip } func (server *BgpServer) dropPeerAllRoutes(peer *Peer, families []bgp.RouteFamily) { + + families = peer.toGlobalFamilies(families) + ids := make([]string, 0, len(server.neighborMap)) if peer.isRouteServerClient() { for _, targetPeer := range server.neighborMap { @@ -512,6 +515,13 @@ func (server *BgpServer) propagateUpdate(peer *Peer, pathList []*table.Path) []* var alteredPathList, withdrawn []*table.Path var best map[string][]*table.Path + if peer != nil && peer.fsm.pConf.Config.Vrf != "" { + vrf := server.globalRib.Vrfs[peer.fsm.pConf.Config.Vrf] + for idx, path := range pathList { + pathList[idx] = path.ToGlobal(vrf) + } + } + if peer != nil && peer.isRouteServerClient() { for _, path := range pathList { path.Filter(peer.ID(), table.POLICY_DIRECTION_IMPORT) @@ -816,12 +826,6 @@ func (server *BgpServer) handleFSMMessage(peer *Peer, e *FsmMsg) { } if len(pathList) > 0 { - if v := peer.fsm.pConf.Config.Vrf; v != "" { - vrf := server.globalRib.Vrfs[v] - for idx, path := range pathList { - pathList[idx] = path.ToGlobal(vrf) - } - } altered := server.propagateUpdate(peer, pathList) if server.isWatched(WATCH_EVENT_TYPE_POST_UPDATE) { _, y := peer.fsm.capMap[bgp.BGP_CAP_FOUR_OCTET_AS_NUMBER] |