summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2015-05-11 22:34:31 +0900
committerFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2015-05-11 22:34:31 +0900
commitd33d15baa6d266730b21f11547962f7ef9ddde8e (patch)
treebb17b17498ba21171cfa111bf68e95f92a155436
parent584428214d0119243e5d51a7adddb7ad12da0714 (diff)
server: don't path information to the same AS number peer
fix the above issue with route server use case. Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
-rw-r--r--server/peer.go4
-rw-r--r--server/server.go2
2 files changed, 6 insertions, 0 deletions
diff --git a/server/peer.go b/server/peer.go
index ccb2538b..8687b106 100644
--- a/server/peer.go
+++ b/server/peer.go
@@ -167,6 +167,10 @@ func (peer *Peer) sendPathsToSiblings(pathList []table.Path) {
msgData: pathList,
}
for _, s := range peer.siblings {
+ if peer.peerConfig.RouteServer.RouteServerClient && peer.peerConfig.PeerAs == s.As {
+ // don't send to a peer having the same AS number.
+ continue
+ }
s.peerMsgCh <- pm
}
}
diff --git a/server/server.go b/server/server.go
index 5492cb1c..92b9b606 100644
--- a/server/server.go
+++ b/server/server.go
@@ -43,6 +43,7 @@ type serverMsg struct {
type serverMsgDataPeer struct {
peerMsgCh chan *peerMsg
address net.IP
+ As uint32
}
type peerMapInfo struct {
@@ -176,6 +177,7 @@ func (server *BgpServer) Serve() {
d := &serverMsgDataPeer{
address: peer.NeighborAddress,
peerMsgCh: pch,
+ As: peer.PeerAs,
}
msg := &serverMsg{
msgType: SRV_MSG_PEER_ADDED,