diff options
author | ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp> | 2015-07-03 15:16:11 +0900 |
---|---|---|
committer | FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> | 2015-07-13 08:56:08 +0900 |
commit | 1bf1652c08dde3368e098c2f28260cb24f4aa0f8 (patch) | |
tree | ae57764ac55db79bdd7cee417ae88ad156129eb9 /server | |
parent | b759f2b1ca7176ea134b3a86d8bfea44509712dd (diff) |
server/table: support iBGP behavior
also added scenario_test
Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
Diffstat (limited to 'server')
-rw-r--r-- | server/server.go | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/server/server.go b/server/server.go index a3d512a9..52c0d3ac 100644 --- a/server/server.go +++ b/server/server.go @@ -314,6 +314,18 @@ func filterpath(peer *Peer, pathList []*table.Path) []*table.Path { continue } + selfGenerated := path.GetSource().ID == nil + fromAS := path.GetSource().AS + myAS := peer.globalConfig.As + if !selfGenerated && !peer.isEBGP && myAS == fromAS { + log.WithFields(log.Fields{ + "Topic": "Peer", + "Key": peer.config.NeighborAddress, + "Data": path, + }).Debug("From same AS, ignore.") + continue + } + if peer.config.NeighborAddress.Equal(path.GetSource().Address) { log.WithFields(log.Fields{ "Topic": "Peer", |